Go Down

Topic: Need a code for an accelerometer and a ESC (Read 235 times) previous topic - next topic

IV_Explorations

Hello all, my name is Stephen and I just bought an arduino kit in hopes of winning the outlaw class for my son's pinewood derby.

So I bought a brushless electric ducted fan (EDF) that will be controlled via an electronic speed controller (ESC) hooked to the Arduino nano. I also plan to attach an accelerometer to the car.

The theory is to activate the EDF for a variable time after the car starts to move down the ramp (sensed by the accelerometer, once the gates are opened. I want variables for time after motion is first sensed (in case of gate clearance timing/issues) and a variable time for the "on" time for the EDF (so it turns off automatically before it runs off the ramp. I also would like a variable for the speed of the ESC so I can play with the throttle percentage.

Problem is the derby is this weekend and I'm having trouble learning how to code that quickly.

Is there anyway someone could help me with the coding to do that?

PaulS

Quote
I want variables for time after motion is first sensed
An accelerometer does not sense motion. It measures acceleration, which is a change in velocity.

For this weekend's event, I'd put a microswitch up front, that is pressed when the car is touching the starting gate, and released when the gate is opened. You'd know to hit the gas when the switch changed to released.

As for the rest of your requirements, declaring variables is so trivial that no one should need to tell you how.
The art of getting good answers lies in asking good questions.

Go Up