ticker direct

Committer:
gr91
Date:
Mon Nov 09 15:49:21 2020 +0000
Revision:
2:b361071cc219
Parent:
1:ed1145480f4b
Child:
3:8a79f8ce8378
Polling

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gr91 0:d4d44e16e7af 1 #include "mbed.h"
gr91 2:b361071cc219 2 // scrutation
gr91 2:b361071cc219 3 DigitalOut ledr(PB_4);//LED_red
gr91 2:b361071cc219 4 DigitalIn DOWN(PB_0); //joystick down
gr91 0:d4d44e16e7af 5 int main()
gr91 0:d4d44e16e7af 6 {
gr91 2:b361071cc219 7 unsigned char DOWN_P=0;
gr91 2:b361071cc219 8 ledr=1; // led r eteinte
gr91 0:d4d44e16e7af 9 while(1) {
gr91 2:b361071cc219 10 if(DOWN && !DOWN_P) {
gr91 2:b361071cc219 11 ledr=!ledr;
gr91 2:b361071cc219 12 }
gr91 2:b361071cc219 13 DOWN_P=DOWN;
gr91 2:b361071cc219 14 wait(0.01);
gr91 0:d4d44e16e7af 15 }
gr91 0:d4d44e16e7af 16 }
gr91 0:d4d44e16e7af 17