Conditional statements in if else
Title
Question
In the if statements there r two functions analogwrite() & digital(), analogwrite() is to power up the selected icpin2/7 depending on the conditional logic, with motor value but idint understand why u r using digital wrte()
Arduino Pulse-Width-Modulation 09-10 min 40-50 sec
Answers:
digitalWrite command sets the pin 2 and pin 7 to high or low state depending on the if condition
digitalWrite command sets the pin to HIGH or LOW state as I told.
The reason we used analogWrite command, because we are taking the motorValue from potentiometer which is connected to analog pin.
Since, analog pins does not give complete HIGH or complete LOW values, after using analogWrite command, we used digitalWrite command with same parameters.
Login to add comment