The 4 LEDs are exercised one at a time moving one way then the other at the end of the row.

Dependencies:   mbed

main.cpp

Committer:
captaintim
Date:
2015-12-16
Revision:
0:a97a819083e9

File content as of revision 0:a97a819083e9:

#include "mbed.h"

/*comments testing lighting of 4 LEDs bouncing*/

int main() {
int on = 1;
int off = 0;
while(1){

 DigitalOut (LED1, on);
 wait (.2);
 
 DigitalOut (LED1, off);
 DigitalOut (LED2, on);
 wait (.2);
 
 DigitalOut (LED2, off);
 DigitalOut (LED3, on);
 wait (.2);
 
 DigitalOut (LED3, off);
 DigitalOut (LED4, on);
 wait (.2);
 
 DigitalOut (LED4, off);
 DigitalOut (LED3, on);
 wait (.2);
 
 DigitalOut (LED3, off);
 DigitalOut (LED2, on);
 wait (.2);
 
 DigitalOut (LED2, off);
  }
}