Skip to content

Instantly share code, notes, and snippets.

@JeffersGlass
Created July 12, 2020 22:47
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 JeffersGlass/bd18eb18531842e1972756e11faee020 to your computer and use it in GitHub Desktop.
Save JeffersGlass/bd18eb18531842e1972756e11faee020 to your computer and use it in GitHub Desktop.
const int LED = 2;
const int button = 5;
void setup() {
// put your setup code here, to run once:
//pinMode(button, INPUT_PULLUP);
//pinMode(LED, OUTPUT);
DDRD = B00000100;
PORTD = B00100000;
}
void loop() {
//int reading = digitalRead(button);
int reading = (PIND & (B00100000)) >> 5;
if (reading){
//digitalWrite(LED, LOW);
PORTD = PORTD & B11111011
}
else {
//digitalWrite(LED, HIGH);
PORTD = PORTD | (B00000100);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment