![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
First Draft, serial print change based on distance
Diff: main.h
- Revision:
- 6:18a4dd77057e
- Parent:
- 5:98845ccaaacd
- Child:
- 7:7464fbb0f3e1
--- a/main.h Sat Jan 22 20:06:35 2022 +0000 +++ b/main.h Mon Jan 24 22:35:08 2022 +0000 @@ -28,7 +28,7 @@ // array of states in the FSM, each element is the output of the counter // set the output in binary to make it easier, 0 is LED on, 1 is LED off -int fsm[6] = {0b1111101, 0b111101, 0b111011, 0b110111, 0b101111, 0b011111}; +int fsm[6] = {0b111110, 0b111101, 0b111011, 0b110111, 0b101111, 0b011111}; void dist(int distance); @@ -42,6 +42,8 @@ void Back_isr(); +void calibrate_object(); + ultrasonic mu(PTD0, PTC12, .5, 1, &dist); //Set the trigger pin to PTD0 and the echo pin to PTC12 //have updates every .5 seconds and a timeout after 1 //second, and call dist when the distance changes