10/29/20 12:23
Dependencies: mbed DRV2605 HCSR04 HC_SR04_Ultrasonic_Library
Diff: main.cpp
- Revision:
- 1:fbdfdb9ecbd2
- Parent:
- 0:00bd403e0742
- Child:
- 2:35ef0b31a857
--- a/main.cpp Thu Oct 29 16:23:43 2020 +0000 +++ b/main.cpp Fri Oct 30 19:24:27 2020 +0000 @@ -5,13 +5,15 @@ #include "ultrasonic.h" #include "DRV2605.h" -DigitalOut audio(p26); //output to speaker amp or audio jack -DigitalOut led(LED1); -DigitalOut led2(LED2); -DRV2605 haptics(p9, p10); + +//DRV2605 haptics(p9, p10); + + + Timeout cycle; + volatile int half_cycle_time = 1; //two calls to this interrupt routine generates a square wave @@ -44,8 +46,8 @@ int main() { - audio = 0; - led = 0; + //audio = 0; + //led = 0; cycle.attach(&toggle_interrupt, half_cycle_time); mu.startUpdates();//start measuring the distance with the sonar while(1) {