saving . . . saved Conditional statements in if else has been deleted. Conditional statements in if else has been hidden .
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 08-05-20, 2:27 p.m. Kastoori

Answers:

digitalWrite command sets the pin 2 and pin 7 to high or low state depending on the if condition
08-05-20, 3:10 p.m. Pratikjb11
Sir,then what about analogwrite does in the above statement
08-05-20, 3:17 p.m. Kastoori

Login to add comment



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.

08-05-20, 5:04 p.m. Pratikjb11


Log-in to answer to this question.