zhouhang shao
/
test
test
Diff: main.cpp
- Revision:
- 0:3c59bc5c9388
- Child:
- 1:11970e541ecf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Feb 26 20:29:20 2017 +0000 @@ -0,0 +1,23 @@ +/** +* This is simple program to test usart with IR sensors. +*/ + +#include "mbed.h" +#include "ir.h" + DigitalOut myLED (LED1); + Serial serial (USBTX, USBRX); + IRSensor testIR (PA_7, PC_7); + + int main () + { + serial.printf ("Start Program \ n \ r"); + while (1) + { + serial.printf("read a val"); + serial.print("value is: ", testIR.readIR();); + myLED = 1; + wait (0.2); + myLED = 0; + wait (1.0); + } + } \ No newline at end of file