Skip to content

Instantly share code, notes, and snippets.

@deviceplususer
Created September 20, 2019 05:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deviceplususer/8f253670a31a983a83bc8e9b6e782ca4 to your computer and use it in GitHub Desktop.
Save deviceplususer/8f253670a31a983a83bc8e9b6e782ca4 to your computer and use it in GitHub Desktop.
const int DIN_PIN = 7;
const int LED_PIN = 13;
void setup(){
pinMode( DIN_PIN, INPUT_PULLUP );
pinMode( LED_PIN, OUTPUT );
}
void loop(){
int value;
value = digitalRead( DIN_PIN );
if ( value == HIGH ){
digitalWrite( LED_PIN, LOW );
}else{
digitalWrite( LED_PIN, HIGH );
}
delay( 100 );
}
@marixapk
Copy link

marixapk commented Mar 8, 2023

Hi if I connect my switch to PC0 pin , then DIN_PIN will be equal to what?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment