Hello everyone,
I wanted to figure out how to manipulate the registers directly in an effort to shave off some bytes from my binary.
My first goal is simply to blink the LED on pin 13 on and off. If I'm reading the schematics right, pin 13 is on PORT C, 5th bit.
As such, here is my code:
From what I understand, this should set up the correct register to output, and then subsequently alternate that same register between high and low with a 100 millisecond delay in between.
I can't figure out with this isn't working. Any clue on what i'm doing wrong?
Thank you!
I wanted to figure out how to manipulate the registers directly in an effort to shave off some bytes from my binary.
My first goal is simply to blink the LED on pin 13 on and off. If I'm reading the schematics right, pin 13 is on PORT C, 5th bit.
As such, here is my code:
Code:
void setup() {
DDRC = (1 << 5);
}
void loop() {
PORTC |= (1 << 5);
delay(100);
PORTC &= ~(1 << 5);
delay(100);
}
From what I understand, this should set up the correct register to output, and then subsequently alternate that same register between high and low with a 100 millisecond delay in between.
I can't figure out with this isn't working. Any clue on what i'm doing wrong?
Thank you!