sadasd

Dependencies:   mbed

Fork of Nucleo_read_button by joseph chen

Committer:
digo1234
Date:
Tue Apr 24 18:39:05 2018 +0000
Revision:
2:5d81a684944c
Parent:
1:52e576abcb8a
teste bot?o

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcostm 0:c9d8fcdda4d0 1 #include "mbed.h"
bcostm 0:c9d8fcdda4d0 2
digo1234 2:5d81a684944c 3 DigitalIn mybutton(D2);
digo1234 2:5d81a684944c 4 int count = 0;
digo1234 2:5d81a684944c 5 int previous =1;
digo1234 2:5d81a684944c 6
bcostm 0:c9d8fcdda4d0 7 int main() {
ittraining 1:52e576abcb8a 8
digo1234 2:5d81a684944c 9
bcostm 0:c9d8fcdda4d0 10 while(1) {
digo1234 2:5d81a684944c 11 if (mybutton == 0 and previous == 1) { // Button is pressed
digo1234 2:5d81a684944c 12 previous = 0;
digo1234 2:5d81a684944c 13 count = count + 1;
digo1234 2:5d81a684944c 14 if (mybutton ==1){
digo1234 2:5d81a684944c 15 previous =1;
bcostm 0:c9d8fcdda4d0 16 }
bcostm 0:c9d8fcdda4d0 17 }
bcostm 0:c9d8fcdda4d0 18 }
digo1234 2:5d81a684944c 19 }