blink an led
Dependencies: mbed
Revision 1:c14fc6db8e1f, committed 2016-05-10
- Comitter:
- maclobdell
- Date:
- Tue May 10 16:46:53 2016 +0000
- Parent:
- 0:232d11a32e07
- Commit message:
- tested, removed code to be added by attendees
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 232d11a32e07 -r c14fc6db8e1f main.cpp --- a/main.cpp Mon May 09 19:47:06 2016 +0000 +++ b/main.cpp Tue May 10 16:46:53 2016 +0000 @@ -3,10 +3,6 @@ DigitalOut red(LED_RED); // we create a variable 'red', use it as an out port Ticker flipper; //Ticker = recurring interrupt to repeatedly call a function at a specified rate -void flip() { - red = !red; -} - // YOUR CODE HERE // this code runs when the microcontroller starts up @@ -14,8 +10,8 @@ red = 1; //turn the led off, (1=off, I know it's weird) // we want to blink an led, every 500 ms. - flipper.attach(&flip, 0.5); // the address of the function to be attached (flip) and the interval (in seconds) - + flipper.attach(&blinky, 0.5); // the address of the function to be attached (flip) and the interval (in seconds) + // spin in a main loop. flipper will interrupt it to call flip while(1) {} }