diff options
Diffstat (limited to 'Pd_firmware')
-rw-r--r-- | Pd_firmware/Pd_firmware.pde | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Pd_firmware/Pd_firmware.pde b/Pd_firmware/Pd_firmware.pde index b76f749..1d64867 100644 --- a/Pd_firmware/Pd_firmware.pde +++ b/Pd_firmware/Pd_firmware.pde @@ -36,7 +36,8 @@ /* * TODO: get digitalInput working - * TODO: add pulseIn functionality + * TODO: add pulseIn/pulseOut functionality + * TODO: save settings to EEPROM * TODO: add software PWM for servos, etc (servo.h or pulse.h) * TODO: redesign protocol to accomodate boards with more I/Os * TODO: add cycle markers to mark start of analog, digital, pulseIn, and PWM @@ -112,7 +113,7 @@ /* two byte PWM data format * ---------------------- - * 0 get ready for digital input bytes (ENABLE_SOFTWARE_PWM/ENABLE_PWM) + * 0 get ready for digital input bytes (ENABLE_PWM) * 1 pin # * 2 duty cycle expressed as 1 byte (255 = 100%) */ @@ -217,18 +218,12 @@ void setPinMode(int pin, int mode) { pwmStatus = pwmStatus &~ (1 << pin); pinMode(pin,OUTPUT); } + // this will apply to all digital pins once softPWM is implemented else if( (mode == PWM) && (pin >= 9) && (pin <= 11) ) { digitalPinStatus = digitalPinStatus | (1 << pin); pwmStatus = pwmStatus | (1 << pin); - softPwmStatus = softPwmStatus &~ (1 << pin); pinMode(pin,OUTPUT); } - else if(mode == SOFTPWM) { - digitalPinStatus = digitalPinStatus | (1 << pin); - pwmStatus = pwmStatus &~ (1 << pin); - softPwmStatus = softPwmStatus | (1 << pin); - pinMode(pin,OUTPUT); - } } void setSoftPwm (int pin, byte pulsePeriod) { @@ -293,7 +288,7 @@ void processInput(byte inputData) { case DISABLE_PWM: setPinMode(storedInputData[0],INPUT); break; - case ENABLE_SOFTWARE_PWM: +/* case ENABLE_SOFTWARE_PWM: setPinMode(storedInputData[1],SOFTPWM); setSoftPwm(storedInputData[1], storedInputData[0]); break; @@ -303,6 +298,7 @@ void processInput(byte inputData) { case SET_SOFTWARE_PWM_FREQ: setSoftPwmFreq(storedInputData[0]); break; + */ } executeMultiByteCommand = 0; } |