jack hanlon
/
KnightRider
1st attempt
Diff: main.cpp
- Revision:
- 2:6baade9068fe
- Parent:
- 0:fb6bbc10ffa0
--- a/main.cpp Sun Jan 01 20:57:57 2012 +0000 +++ b/main.cpp Thu Nov 26 14:01:56 2020 +0000 @@ -1,12 +1,53 @@ #include "mbed.h" - -DigitalOut myled(LED1); - +/////////////////////////////////// +///////Knight rider//////////////// +///////Jack Hanlon 26/11/20//////// +////////////////////////////////// +DigitalOut led1(LED1); +DigitalOut led2(LED2); +DigitalOut led3(LED3); +DigitalOut led4(LED4); int main() { while(1) { - myled = 1; - wait(0.2); - myled = 0; - wait(0.2); + led1= 1; + wait(.5); + led1=0; + wait(.1); + led2=1; + wait(.5); + led2=0; + wait(.1); + led3 =1; + wait(.5); + led3=0; + wait(.1); + led4=1; + wait(.5); + led4=0; + wait(.5); +/////////////////////////// +//ligts forward/////////// +///////////////////////// + led4= 1; + wait(.5); + led4=0; + wait(.1); + led3=1; + wait(.5); + led3=0; + wait(.1); + led2=1; + wait(.5); + led2=0; + wait(.1); + led1=1; + wait(.5); + led1=0; + wait(.5); +///////////////////////// +//lights backward/////// +/////////////////////// + + } }