-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pulse Width Duty Cycle #2
Comments
Hi, Randy. I'm trying to use this plugin to control some LEDs. Have you found the way to control the pwm duty cycle? |
No, unfortunately not. I used an Arduino instead.
|
I took a look at the code, and I found this in @Override protected void setup() throws ConnectionLostException,InterruptedException { led_ = ioio_.openDigitalOutput(IOIO.LED_PIN); for(Integer pinPort:pins.keySet()){ Pin pin = pins.get(pinPort); if(pin instanceof PinPwmOutput){ // PinPwmOutput PinPwmOutput pinPwmOutput = (PinPwmOutput)pin; pinPwmOutput.pwmOutput = ioio_.openPwmOutput(pinPort, PWN_MAX_FREQ); ... and this in line 151: Pin pin = pins.get(pinPort); if(pins.get(pinPort) instanceof PinPwmOutput){ // PinPwmOutput PinPwmOutput pinPwmOutput = (PinPwmOutput)pins.get(pinPort); pinPwmOutput.pwmOutput.setPulseWidth(pinPwmOutput.freq); try { parameters.put(pinPwmOutput.getJson()); } catch (Exception e) {} It seems that the author set up the pwmOutput with the |
Can any tell me if this code supports the ability to set the duty cycle on a pulse modulation? I'd like to be able to control some servos.
Thank you in advance!
Randy
The text was updated successfully, but these errors were encountered: