Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of All-15 by
Diff: main.cpp
- Revision:
- 2:1317061163f8
- Parent:
- 1:28cfac75543f
- Child:
- 3:2cd73b6f5b50
diff -r 28cfac75543f -r 1317061163f8 main.cpp --- a/main.cpp Tue Jul 07 20:36:32 2015 +0000 +++ b/main.cpp Tue Jul 07 20:51:37 2015 +0000 @@ -20,8 +20,18 @@ DigitalIn SensorL(P1_12); DigitalIn SensorR(P1_13); int data; +int out_helper[8]; int main() { + out_helper[0]=0; + out_helper[1]=1; + out_helper[2]=3; + out_helper[3]=7; + out_helper[4]=15; + out_helper[5]=14; + out_helper[6]=12; + out_helper[7]=8; + enable = 0; online = 0; Motor_SENSOR=0; @@ -54,11 +64,6 @@ int waiting = 0; bool active = false; - enable = 1; - online = 1; - while(1){ - myled=myline; - } while(1){ // Einlesen der Taster und speichern unter data i2c.start(); @@ -73,20 +78,33 @@ { enable = 1; online = 1; + myrgb=4; + wait(0.5); } else { - if(waiting<8) + if(waiting<7) waiting++; else { - enable = 1; - online = 1; - - enable = 0; - online = 0; + enable = 1; + online = 1; + if(myline>0||linecenter>0) + { + active=1; + myrgb=6; + } + else + myrgb=3; + waiting=0; + wait(0.5); + enable = 0; + online = 0; + myrgb=7; } + myled=out_helper[waiting]; } + //0=>keine Linie //01->forneMitte //02->hintenMitte