
For use in my acoustic touchscreen project, found here: http://hackaday.io/project/1990-Low-Cost-Touchscreen-Anywhere
Diff: main.cpp
- Revision:
- 2:2ccbee38f4a8
- Parent:
- 1:62933cace87a
- Child:
- 3:5d221e8f4012
--- 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;