void setup()
{
pinMode (pinNumber, INPUT);
}
void loop()
{
int buttonState = digitalRead(2);
if(buttonState == HIGH)
{ // do something
}
else
{ // do something else
}
}]] ></ac:plain-text-body></ac:structured-macro></div></td><td><div class="content-wrapper"><p><ac:image ac:width="350"><ri:attachment ri:filename="image2020-1-21_21-21-50.png" /></ac:image></p></div><p><br /></p><p><br /></p><p>In Tinkercad, we just need to Start Simulation, and click on the switch to turn it on/off.</p></td></tr></tbody></table><h3>Screencast</h3><p><ac:structured-macro ac:name="widget" ac:schema-version="1" ac:macro-id="9c9d6a73-fbe8-46a3-ab73-622cbf1ce09a"><ac:parameter ac:name="url"><ri:url ri:value="http://youtube.com/watch?v=MTXZPYaKQXE" /></ac:parameter></ac:structured-macro></p><p><brtable><p><br /></p><p><br /></p> |