Doubt in tutorial Pulse width Modulation
Title
Question
<span style="font-family: Arial, Helvetica, sans-serif; font-size: small;">At time 9: 30 in the tutorial the input to the Function map (potvalue, 0,1023,0,255)is not explained. </span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: small;">and </span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: small;">At time 9: 45 in the tutorial the input to the Function </span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: small;">analogWrite (fwdbuttonState == Low ? ICpin2: ICpin7,motorvalue); </span>
digitalWrite (fwdbuttonState == Low ? ICpin2: ICpin7,motorvalue);
<span style="font-family: Arial, Helvetica, sans-serif; font-size: small;">is not explained properly..</span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: small;">Thanks!</span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: small;">Thanks!</span>
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.
Login to add comment