ARES
/
Timer
Time is good
Fork of Robot2016_2-0 by
couleur.cpp@83:714fa414b2bf, 2016-05-06 (annotated)
- Committer:
- IceTeam
- Date:
- Fri May 06 09:20:49 2016 +0200
- Revision:
- 83:714fa414b2bf
- Child:
- 84:b54822c913b0
Rajout gestion des couleurs
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
IceTeam | 83:714fa414b2bf | 1 | #include "entete.h" |
IceTeam | 83:714fa414b2bf | 2 | |
IceTeam | 83:714fa414b2bf | 3 | void changeCamp(void) |
IceTeam | 83:714fa414b2bf | 4 | { |
IceTeam | 83:714fa414b2bf | 5 | if(SCouleur==VERT) { |
IceTeam | 83:714fa414b2bf | 6 | SCouleur = VIOLET; |
IceTeam | 83:714fa414b2bf | 7 | LEDR = 1; |
IceTeam | 83:714fa414b2bf | 8 | LEDV = 0; |
IceTeam | 83:714fa414b2bf | 9 | } if (SCouleur == VIOLET) { |
IceTeam | 83:714fa414b2bf | 10 | SCouleur = NOIR; |
IceTeam | 83:714fa414b2bf | 11 | LEDV = 0; |
IceTeam | 83:714fa414b2bf | 12 | LEDR = 0; |
IceTeam | 83:714fa414b2bf | 13 | } |
IceTeam | 83:714fa414b2bf | 14 | else { |
IceTeam | 83:714fa414b2bf | 15 | SCouleur = NOIR; |
IceTeam | 83:714fa414b2bf | 16 | LEDV = 1; |
IceTeam | 83:714fa414b2bf | 17 | LEDR = 0; |
IceTeam | 83:714fa414b2bf | 18 | } |
IceTeam | 83:714fa414b2bf | 19 | } |
IceTeam | 83:714fa414b2bf | 20 | |
IceTeam | 83:714fa414b2bf | 21 | void depart(void) |
IceTeam | 83:714fa414b2bf | 22 | { |
IceTeam | 83:714fa414b2bf | 23 | while(button==1) { |
IceTeam | 83:714fa414b2bf | 24 | if(CAMP==0) { |
IceTeam | 83:714fa414b2bf | 25 | changeCamp(); |
IceTeam | 83:714fa414b2bf | 26 | } |
IceTeam | 83:714fa414b2bf | 27 | wait_ms(100); |
IceTeam | 83:714fa414b2bf | 28 | } |
IceTeam | 83:714fa414b2bf | 29 | } |