2 limit switches wiring using same pin Arduino

void setup() {
Serial.begin(9600);
// put your setup code here, to run once:
pinMode( 7 , INPUT );
pinMode( 13, OUTPUT); // LED FOR TEST

digitalWrite(13,LOW);
}

void loop() {

// put your main code here, to run repeatedly:
if( digitalRead(7) == LOW ){
digitalWrite(13,HIGH);
}else{
digitalWrite(13,LOW);
}
} ::::::::::: SUPPORT CHANNEL ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Please Donate To Help Me Afford New Equipment And Software To Make My Videos More : https://goo.gl/1m8Dg2

Don’t forget to subscribe!

, https://i.ytimg.com/vi/zBE6aY0NPSQ/hqdefault.jpg

source

13 Comments

  1. Hello Friend.
    I am in the project of updating a laser cutting machine. Could you help me with the wiring for the X and Z limit switches? I have a map of the card. Is it possible to send it to your email to help me? It would be something that I would really appreciate!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.