Your explanation and demonstration was very clear. When I wired up the LED and switch as you showed and entered the code it worked first time. I liked the way you entered code and the altered it as you went along. It really helped my understanding of developing code as one proceeds with the design.
@EnjoyMechatronics Жыл бұрын
Glad it helped
@nyaa2054 Жыл бұрын
Good vidio. This video explains step by step. Very understanding
@EnjoyMechatronics Жыл бұрын
Glad it was helpful!
@brothersinformation6615 Жыл бұрын
Why you wrote oldValue = newValue at last
@johngardiner2178 Жыл бұрын
epic video i learn every time i follow your tutorial one more step towards my steper motoer control code with push button and limit switch controller :-) ty
@EnjoyMechatronics Жыл бұрын
Great to hear!
@mathieubannwarth73812 жыл бұрын
Hi! Is there a way to do the opposite? use a physical toggle switch to create a push button action? I am a total newbie when it comes to Arduino. thanks a lot
@willemidaho Жыл бұрын
Another good video!
@EnjoyMechatronics Жыл бұрын
Thanks 😊
@agustin_crak553425 күн бұрын
int pinbo = 2; int state; int oldstate = 1; int led = 8; class String ledstate = "OFF"; void setup(){ pinMode(pinbo,INPUT_PULLUP); pinMode(led,OUTPUT); } void loop(){ state = digitalRead(pinbo); oldstate = state; if(state == 1 && oldstate == 1){ if(ledstate == "OFF"){ digitalWrite(led,HIGH); ledstate = "ON"; } else { digitalWrite(led,LOW); ledstate = "OFF"; } } delay(1); }