Updated to use the bitshift for hte LED port
This commit is contained in:
parent
2ab9d8e18e
commit
577ccb79e2
16
src/main.c
16
src/main.c
|
@ -10,8 +10,9 @@
|
|||
//Globals
|
||||
//#############################
|
||||
|
||||
#define LED_PIN PB0
|
||||
|
||||
#define LED_PORT (1<<5)
|
||||
#define LED_PIN PB5
|
||||
#define BLINK_DELAY_MS 5000
|
||||
|
||||
//#############################
|
||||
//Prototypes
|
||||
|
@ -38,7 +39,6 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
|
||||
|
||||
//#############################
|
||||
//FUNCTIONS
|
||||
//#############################
|
||||
|
@ -50,12 +50,12 @@ int main(int argc, char **argv)
|
|||
*/
|
||||
void led_blink(void) {
|
||||
//Set the DDR for output.
|
||||
DDRC |= (1<<LED_PIN);
|
||||
DDRB |= LED_PORT;
|
||||
|
||||
PORTC ^= (1<<LED_PIN);
|
||||
_delay_ms(250);
|
||||
PORTC ^= (1<<LED_PIN);
|
||||
_delay_ms(250);
|
||||
PORTB ^= (1<<LED_PIN);
|
||||
_delay_ms(500);
|
||||
PORTB ^= (1<<LED_PIN);
|
||||
_delay_ms(500);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue