Created libraries2
Dependencies: mbed ultrasonic
Diff: main.cpp
- Revision:
- 13:2169890a1508
- Parent:
- 12:086122072266
- Child:
- 14:10b62201c9de
--- a/main.cpp Thu Apr 23 07:06:33 2015 +0000 +++ b/main.cpp Thu Apr 23 08:21:20 2015 +0000 @@ -1,10 +1,10 @@ #include "mbed.h" #include "ultrasonic.h" -PwmOut TX1(D9); // Use pin D9 -DigitalOut TX2(D8); // Use pin D8 -DigitalOut HVoff(D6); // Use pin D6 -InterruptIn signal(D7); // Use pin D7 +PwmOut TX1(D11); // Use pin D11 +DigitalOut TX2(D10); // Use pin D10 +DigitalOut HVoff(D12); // Use pin D12 +InterruptIn signal(D13); // Use pin D13 Timeout to1; Timer t1; Serial pc(SERIAL_TX, SERIAL_RX); @@ -14,13 +14,13 @@ void TX1_send(){ previous = 1; - HVoff = 1; + HVoff = 0; TX1.period(0.0000252); // Set the period of TX1 to 25.2us (39,682kHz) TX1.pulsewidth(0.0000116); // Set the pulsewidth of TX1 to 11.6us (ON) wait(0.000300); // Waits 201.6us - TX1 = 1; + TX1 = 0; t1.reset(); - HVoff = 0; + HVoff = 1; to1.attach(TX1_send,0.1); // Sends for 1000us } @@ -50,7 +50,7 @@ t1.start(); signal.fall(&signal_reciev); - TX2 = 0; + TX2 = 1; TX1_send(); while(1); } \ No newline at end of file