Last active
April 24, 2023 19:48
-
-
Save bradford-hamilton/c9cea8975f2fbf7ffd7826461dd56048 to your computer and use it in GitHub Desktop.
ATtiny85 - Initial LED on example for post
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Port B data direction register 0x17 (+ 0x20 for the special func register offset) | |
#define DDRB *((volatile unsigned char*)0x37) | |
// Port B data register 0x18 (+ 0x20 for the special func register offset) | |
#define PORTB *((volatile unsigned char*)0x38) | |
int main() | |
{ | |
// Set data direction for Port B bit 0 (PB0 - pin 5) | |
DDRB |= (1 << 0); | |
// Set data for Port B bit 0 (PB0 - pin 5) to 1 | |
PORTB |= (1 << 0); | |
while (1) {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment