Pinscape Controller version 1 fork. This is a fork to allow for ongoing bug fixes to the original controller version, from before the major changes for the expansion board project.
Dependencies: FastIO FastPWM SimpleDMA mbed
Fork of Pinscape_Controller by
Diff: main.cpp
- Revision:
- 30:6e9902f06f48
- Parent:
- 29:582472d0bc57
- Child:
- 33: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 {