-
Dependencies: mbed
Revision 1:24f21be80e14, committed 2018-04-18
- Comitter:
- NathanLederman
- Date:
- Wed Apr 18 15:27:14 2018 +0000
- Parent:
- 0:07055f3355f6
- Commit message:
- -
Changed in this revision
diff -r 07055f3355f6 -r 24f21be80e14 Nucleo.h --- a/Nucleo.h Wed Mar 07 14:20:11 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - -#include "mbed.h" - -DigitalOut myled(LED1); -DigitalIn pb(USER_BUTTON); - -// SPST Pushbutton demo using internal PullUp function -// no external PullUp resistor needed -// Pushbutton from P8 to GND. -int main() { - pb.mode(PullUp); - while(1) { - myled = pb; - } -} \ No newline at end of file
diff -r 07055f3355f6 -r 24f21be80e14 Teste2.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Teste2.cpp Wed Apr 18 15:27:14 2018 +0000 @@ -0,0 +1,32 @@ +#include "mbed.h" + +DigitalIn mybutton(USER_BUTTON); +DigitalIn habilita(PA_6); +DigitalOut myled(LED1); +DigitalOut enable (PB_6); +DigitalOut dir(PB_9); +DigitalOut step(PB_8); +//int lista[4][4] ={{0,0,0,1},{0,0,1,0},{0,1,0,0},{1,0,0,0}} +//int listainv[4][4] ={{1,0,0,0},{0,1,0,0},{0,0,1,0},{0,0,0,1}} + + +int main () { +enable = 0; + + while(1) { + if (mybutton == 0) { // botão usuário pressionado + dir = !dir; + } + step = 0; + wait(0.01); + step = 1; + wait(0.01); + + if (habilita == 0) { // botão externo pressionado + enable = !enable; + } +//myled = !myled; +//step = !step; +//wait(0.01); + } +} \ No newline at end of file
diff -r 07055f3355f6 -r 24f21be80e14 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Apr 18 15:27:14 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/aa5281ff4a02 \ No newline at end of file