Updated to use the bitshift for hte LED port

This commit is contained in:
jakeg00dwin 2024-06-14 16:11:44 -07:00
parent 2ab9d8e18e
commit 577ccb79e2
1 changed files with 8 additions and 8 deletions

View File

@ -10,8 +10,9 @@
//Globals //Globals
//############################# //#############################
#define LED_PIN PB0 #define LED_PORT (1<<5)
#define LED_PIN PB5
#define BLINK_DELAY_MS 5000
//############################# //#############################
//Prototypes //Prototypes
@ -38,7 +39,6 @@ int main(int argc, char **argv)
} }
//############################# //#############################
//FUNCTIONS //FUNCTIONS
//############################# //#############################
@ -50,12 +50,12 @@ int main(int argc, char **argv)
*/ */
void led_blink(void) { void led_blink(void) {
//Set the DDR for output. //Set the DDR for output.
DDRC |= (1<<LED_PIN); DDRB |= LED_PORT;
PORTC ^= (1<<LED_PIN); PORTB ^= (1<<LED_PIN);
_delay_ms(250); _delay_ms(500);
PORTC ^= (1<<LED_PIN); PORTB ^= (1<<LED_PIN);
_delay_ms(250); _delay_ms(500);
} }