![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
work in progress
Dependencies: FastAnalogIn FastIO USBDevice mbed FastPWM SimpleDMA
Fork of Pinscape_Controller by
Diff: main.cpp
- Revision:
- 32:6e9902f06f48
- Parent:
- 31:582472d0bc57
- Child:
- 35:d832bcab089e
--- a/main.cpp Fri Sep 25 18:49:53 2015 +0000 +++ b/main.cpp Fri Sep 25 21:28:31 2015 +0000 @@ -610,25 +610,24 @@ else if (val == 129) { // 129 = ramp up / ramp down - if (wizFlashCounter < 128) - return wizFlashCounter/127.0; - else - return (255 - wizFlashCounter)/127.0; + return wizFlashCounter < 128 + ? wizFlashCounter/128.0 + : (256 - wizFlashCounter)/128.0; } else if (val == 130) { // 130 = flash on / off - return (wizFlashCounter < 128 ? 1.0 : 0.0); + return wizFlashCounter < 128 ? 1.0 : 0.0; } else if (val == 131) { // 131 = on / ramp down - return (255 - wizFlashCounter)/255.0; + return wizFlashCounter < 128 ? 1.0 : (255 - wizFlashCounter)/128.0; } else if (val == 132) { // 132 = ramp up / on - return wizFlashCounter/255.0; + return wizFlashCounter < 128 ? wizFlashCounter/128.0 : 1.0; } else {