vault backup: 2025-04-09 15:37:01
This commit is contained in:
parent
ff071c6d35
commit
a052f8ec97
@ -1,16 +1,16 @@
|
|||||||
#include <avr/io.h>
|
#include <avr/iom328p.h>
|
||||||
#include <util/delay.h>
|
#include <util/delay.h>
|
||||||
|
|
||||||
// The main function: our program entry point
|
// The main function: our program entry point
|
||||||
int main(void) {
|
int main(void) {
|
||||||
// Set PB5 as output. DDRB is the data direction register for port B.
|
// Set PB5 as output. DDRB is the data direction register for port B.
|
||||||
// (1 << PB5) shifts 1 over by PB5 bits creating a bitmask.
|
// (1 << PB5) shifts 1 over by PB5 bits creating a bitmask.
|
||||||
DDRB |= (1 << PB5);
|
DDRB |= (1 << DDB5);
|
||||||
|
|
||||||
// Infinite loop to blink the LED
|
// Infinite loop to blink the LED
|
||||||
while (1) {
|
while (1) {
|
||||||
// Set PB5 high: LED ON
|
// Set PB5 high: LED ON
|
||||||
PORTB |= (1 << PB5);
|
PORTB |= (1 << PORTB5B5);
|
||||||
_delay_ms(100); // Delay 1000 milliseconds (1 second)
|
_delay_ms(100); // Delay 1000 milliseconds (1 second)
|
||||||
|
|
||||||
// Clear PB5: LED OFF
|
// Clear PB5: LED OFF
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user