Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
