Need Help ?

Home / Expert Answers / Other / arduino-code-and-diagram-pleasearduino-code-that-changes-the-velocity-speed-4-different-ones-ofthe-s

(Answered): Arduino code and diagram pleasearduino code that changes the velocity/speed (4 different ones) ofthe ...



Build a state-machine embedded application as an Arduino sketch (program) that does the following... if the motor is stopped,

Arduino code and diagram please
arduino code that changes the velocity/speed (4 different ones) ofthe stepper motor every time the 1st push button is pressed andstops/remembers its current velocity when the 2nd push button ispressed

Build a state-machine embedded application as an Arduino sketch (program) that does the following... if the motor is stopped, when the user pushes a push-button (which I will call INPUT1), the motor begins rotating o if there is a currVelocity set, the motor rotates at this velocity o if currVelocity has not been set, the motor rotates at an initial slow velocity (chosen by you) · if the motor is running, when the user pushes the push-button INPUT1, the motor speeds up again (to 2nd velocity, and beyond). Once the motor reaches the maximum velocity, additional pushes of INPUT1 have no effect. • the various velocities are chosen by you, but you must use at least 4 different velocities. · if the motor is running, and the user activates another piece of input hardware (*YOUR CHOICE*...but I will call it INPUT2) the motor stops, but remembers its current velocity in variable currVelocity • if the motor is stopped, and the user activates INPUT2, the currVelocity is cleared (reset to 0) . Requirements: • The states are listed in an enumeration in the code, and have capital letters as their name · When a state is entered (including the initial state, named something like INIT), a function is called which is named after that state, like statelnit(...) Each state function (named after the state, e.g. statelnit(...)) has two segments of code . a portion of code that is only executed once each time the state is entered a portion of code that executes repeatedly as long as you're in the state (typically a conditional to see if we must transition out of the state) The loop() function has a switch statement inside which identifies the current state (e.g. INIT) and calls that state's function (e.g. statelnit(...)) o


We have an Answer from Expert

View Expert Answer

Expert Answer


Answer to Arduino code and diagram please arduino code that changes the velocity/speed (4 different ones) of the stepper motor eve...
We have an Answer from Expert

Buy This Answer $4

Place Order