Xmas tree serial LED blinking example code
Fork of JBB_SerialLED_test by
Revision 2:20fc73d3b706, committed 2016-12-12
- Comitter:
- MACRUM
- Date:
- Mon Dec 12 08:22:19 2016 +0000
- Parent:
- 1:832ea8c566a8
- Commit message:
- Change instance name
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 832ea8c566a8 -r 20fc73d3b706 main.cpp --- a/main.cpp Mon Dec 12 05:55:57 2016 +0000 +++ b/main.cpp Mon Dec 12 08:22:19 2016 +0000 @@ -11,7 +11,7 @@ #define NUM_LEDS 40 #define MAX_LEVEL 255 -DigitalIn rip(p17); +DigitalIn sensor(p17); DigitalOut myled(LED1); void blink_1(int); @@ -97,11 +97,11 @@ int main() { tapeInit(0, START_ID + NUM_LEDS); // freq( 0:default ) , SerialLED num - rip.mode(PullDown); + sensor.mode(PullDown); + int detect = sensor.read(); - int sensor = rip.read(); while(1) { - if (sensor == 1) { + if (detect == 1) { myled = 1; blink_1(6); blink_2(1); @@ -110,7 +110,7 @@ } myled = 0; wait(0.5); - sensor = rip.read(); + detect = sensor.read(); } }