Matthew Shuman
/
Lab1TestAdvanced
This loops through PWM outputs connected to the red and green LED.
Diff: main.cpp
- Revision:
- 5:10267572c71b
- Parent:
- 4:a8b0243f29b7
--- a/main.cpp Sat Aug 13 08:36:34 2016 +0000 +++ b/main.cpp Sat Aug 13 08:39:25 2016 +0000 @@ -12,7 +12,8 @@ while (true) { for (float i = 0.0f; i < 1.0f ; i += 0.001f) { float j = 2 * i; //Sweep the j value between 0 and 2, with .002 steps - if(p<1) + + if(j<1) r=j; else r=j-1; //Sweep the red LED 2 times during the loop, igorning the integer portion of the float number.