Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 0:62ac378df546
- Child:
- 1:ed00e9c4ba6e
diff -r 000000000000 -r 62ac378df546 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Apr 19 09:14:08 2013 +0000
@@ -0,0 +1,60 @@
+#include "mbed.h"
+#include "TextLCD.h"
+#include "main.h"
+
+
+int a;
+int xbee;
+
+void init()
+{
+ device.printf("START");
+ device2.printf("START");
+ device.attach(&dev_tx,Serial::TxIrq);
+ device.attach(&dev_rx,Serial::RxIrq);
+ device2.attach(&dev2_tx,Serial::TxIrq);
+ device2.attach(&dev2_rx,Serial::RxIrq);
+ Button.mode(PullUp);
+
+ timer2.start();
+
+ lcd.cls();
+}
+int main()
+{
+ init();
+
+ for(;;){
+ //mbedleds = 0;
+
+
+ Ultrasonic();
+ //lcd.cls();
+
+ IR_Position();
+ lcd.cls();
+
+ lcd.locate(0,0);
+ lcd.printf("R:%d,F:%d",(int)ultrasonicValue[1],(int)ultrasonicValue[0]);
+ lcd.locate(0,1);
+ lcd.printf("L:%d,B:%d",(int)ultrasonicValue[3],(int)ultrasonicValue[2]);
+
+ /*
+ lcd.locate(0,0);
+ lcd.printf("%d",(data[0] << 8) + data[1]);
+ lcd.locate(0,1);
+ lcd.printf("%d",data[2]);
+ */
+ /*
+ lcd.locate(0,0);
+ lcd.printf("%d,%d",direction,data[2]);
+ lcd.locate(0,1);
+ lcd.printf("%d",Distance);
+ */
+ /*
+ lcd.locate(0,0);
+ lcd.printf("%d",data[0]);
+ lcd.locate(0,1);
+ lcd.printf("%d",data[1]);*/
+ }
+}