Skip to content

Instantly share code, notes, and snippets.

@extrasleepy
Last active August 29, 2015 14:11
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 extrasleepy/9ad7c6439b7b1b93b59b to your computer and use it in GitHub Desktop.
Save extrasleepy/9ad7c6439b7b1b93b59b to your computer and use it in GitHub Desktop.
AVR Direct Port Addressing
//avr direct port addressing
void setup(){
DDRD = B10000000; //digital 7-0 //7 is output here
DDRB = B00010000; //digital 15-8 //12 is output here
}
void loop(){
PORTD = B10000000; //7 high
PORTB = B00000000; //all low
delay(100);
PORTD = B00000000; //all low
PORTB = B00010000; //12 high
delay(100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment