Doubt in tutorial Pulse width Modulation
At time 9: 30 in the tutorial the input to the Function map (potvalue, 0,1023,0,255) is not explained.
and
At time 9: 45 in the tutorial the input to the Function
analogWrite (fwdbuttonState == Low ? ICpin2: ICpin7,motorvalue);
digitalWrite (fwdbuttonState == Low ? ICpin2: ICpin7,motorvalue);
is not explained properly..
Thanks!
Thanks!
Arduino Pulse-Width-Modulation 11-12 min 10-20 sec
Answers:
The Map command r<span style="color: rgb(0, 0, 0); font-family: "Open Sans", "Lucida Grande", Lucida, Verdana, sans-serif; font-size: 16px; letter-spacing: 0.16px;">e-maps a number from one range to another. In other words, a value of </span>fromLow<span style="color: rgb(0, 0, 0); font-family: "Open Sans", "Lucida Grande", Lucida, Verdana, sans-serif; font-size: 16px; letter-spacing: 0.16px;"> would get mapped to </span>toLow<span style="color: rgb(0, 0, 0); font-family: "Open Sans", "Lucida Grande", Lucida, Verdana, sans-serif; font-size: 16px; letter-spacing: 0.16px;">, a value of </span>fromHigh<span style="color: rgb(0, 0, 0); font-family: "Open Sans", "Lucida Grande", Lucida, Verdana, sans-serif; font-size: 16px; letter-spacing: 0.16px;"> to </span>toHigh .
And at 9.45, the If command checks the push buttons connected to pin 12 and 13 are pressed or not.