yanay nevela
/
lab9_2
s
Diff: main.cpp
- Revision:
- 0:259c3f9d6fd3
diff -r 000000000000 -r 259c3f9d6fd3 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed May 04 15:09:45 2016 +0000 @@ -0,0 +1,33 @@ +#include "mbed.h" +Serial RN42(p9, p10); +Serial pc(USBTX,USBRX); +DigitalOut RN42_led(LED1); +DigitalOut pc_led(LED2); +DigitalIn joycenter(p14); +InterruptIn obj(p14); +void joy() +{ + wait_ms(25); + if(joycenter) + { + pc.printf("$$$\r\n"); + if(RN42.readable()) + { + while(RN42.getc() != '\n'){} + } + pc.printf("r,1\r\n"); + } + +} +int main() { + + RN42.baud(115200); + pc.baud(115200); + pc.printf("Ready\n"); + obj.rise(&joy); + joycenter.mode (PullDown); + while(1) + { + + } +}