Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I have made sure all my hardware is wired correctly to the best of knowlege but when i run the program and press each button
I have made sure all my hardware is wired correctly to the best of knowlege but when i run the program and press each button the motor stays at RPM my objective is to get the motor to move in the positive direction with one button and the negative with the other. I will provide my code as well. variables
const int forwardPin ;
const int backwardPin ;
const int delayTime ;
const int butpin ;
const int butpin ;
int but;
int but;
void setup
pinModeforwardPinOUTPUT;
pinModebackwardPinOUTPUT;
pinModebutpin,INPUTPULLUP;
pinModebutpin,INPUTPULLUP;
void loop
but digitalReadbutpin;
but digitalReadbutpin;
ifbut HIGH
digitalWriteforwardPinLOW;
else
digitalWriteforwardPinHIGH;
ifbut HIGH
digitalWritebackwardPinLOW;
else
digitalWritebackwardPinHIGH;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started