I am working on a Sip & Puff control for a radio controlled car using a UNO board. I started with the sketch that Bob Paradiso had already made. I’ve made some modifications to that sketch for my hardware and application. There is a pressure switch that measures +/- 1 psi. To control the car you give 2 quick puffs, by mouth, into the pressure switch and the car goes forward, 2 quick Sips and it goes reverse. A single sustained puff turns right, single sustained sip turns left.
The problem is when you do the 2 puffs to go forward the steering also does 2 quick rights returning to center between. Same with 2 sips to go reverse I get 2 lefts. I want to add a delay so the steering does not jerk back and forth while doing the 2 quick sip/puffs.
I’ve tried a couple of things. First I set a variable (SteeringPause) to a 1 when the sip/puff starts and put that as a “AND” condition in the steering control If function. Setting the variable back to 0 when the direction was set. The other thing I tried was a time delay (SteeringPauseStart) subtracting "millis() and comparing that to a set delay (SteeringPauseDelay) putting that in my if condition as well. I’ve tried a number of variations of these and I can get it so it either doesn’t work at all or I get no steering at all.
I’ve attached both my sketch and a wiring diagram. Not everything on the wiring is used in this sketch. I have another sketch that controls the car via a joystick. I did get that one to work properly.
All suggestions, comments and criticisms welcomed
Arduino UNO Interface.pdf (141 KB)
sipPuffToyCar_Mod.ino (9.63 KB)