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:
- 2:2ccbee38f4a8
- Parent:
- 1:62933cace87a
- Child:
- 3:5d221e8f4012
diff -r 62933cace87a -r 2ccbee38f4a8 main.cpp
--- a/main.cpp Sun Jul 27 21:31:20 2014 +0000
+++ b/main.cpp Sat Aug 09 15:04:11 2014 +0000
@@ -1,5 +1,6 @@
#include "mbed.h"
+Serial pc(dp16,dp15);
DigitalOut myled(dp1);
DigitalOut led2(dp4);
InterruptIn int1(dp14);
@@ -61,7 +62,8 @@
}
int main() {
- printf("Ready\n");
+ pc.baud(115200);
+ pc.printf("Ready\n");
int1.fall(&flip1);
int2.fall(&flip2);
timeArray[0] = 0;
@@ -69,7 +71,9 @@
timeArray[2] = 0; //for now this isn't used (only two sensors)
while(1){
if(timeAvailable){
- printf("[%f, %f]\n",timeArray[0],timeArray[1]);
+ int tA0 = int(timeArray[0]*1000000);
+ int tA1 = int(timeArray[1]*1000000);
+ pc.printf("[%i, %i]\n",tA0,tA1);
t.reset();
timeArray[0] = 0;
timeArray[1] = 0;