Edwin Foster
/
HelloWorld
First mbed program example and usage
Fork of HelloWorld by
Diff: main.cpp
- Revision:
- 4:48af6a1a72c6
- Parent:
- 3:26b01dec4312
--- a/main.cpp Sat Oct 18 14:20:50 2014 +0000 +++ b/main.cpp Sat Nov 08 14:10:49 2014 +0000 @@ -12,14 +12,11 @@ while(1) { for(i = 0 ; i < TOTAL_LEDS; i++){ int value_to_check = i + 1; - if( value_to_check == last_selected){ - outleds[i] = 1; - }else{ - outleds[i] = 0; - } + outleds[i] = value_to_check == last_selected ? 1 : 0; } wait(1); + if(last_selected++ >= TOTAL_LEDS) last_selected = 1; }