From b26017d62c784b8190e8040801102528a2563ac8 Mon Sep 17 00:00:00 2001 From: Vladimir Garistov Date: Mon, 16 Oct 2023 15:30:39 +0300 Subject: [PATCH] Fixed bit names in register GPIO example --- .../GPIO/Register_Blink/Register_Blink.ino | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Examples/GPIO/Register_Blink/Register_Blink.ino b/Examples/GPIO/Register_Blink/Register_Blink.ino index 16d6a65..6b28dff 100644 --- a/Examples/GPIO/Register_Blink/Register_Blink.ino +++ b/Examples/GPIO/Register_Blink/Register_Blink.ino @@ -1,12 +1,14 @@ -void setup() { - DDRB |= (1 << PB5); // Set digital pin 13 (Port B Pin 5) to output +void setup() +{ + DDRB |= (1 << DDB5); // Set digital pin 13 (Port B Pin 5) to output } -void loop() { - PORTB |= (1 << PB5); // Set digital pin 13 (Port B Pin 5) high - _delay_ms(500); // wait 500ms - PORTB &= ~(1 << PB5); // Set digital pin 13 (Port B Pin 5) low - _delay_ms(500); // wait 500ms +void loop() +{ + PORTB |= (1 << PORTB5); // Set digital pin 13 (Port B Pin 5) high + delay(500); // wait 500ms + PORTB &= ~(1 << PORTB5); // Set digital pin 13 (Port B Pin 5) low + delay(500); // wait 500ms - //PORTB ^= (1 << PB5); // Toggle digital pin 13 (Port B Pin 5) + //PORTB ^= (1 << PORTB5); // Toggle digital pin 13 (Port B Pin 5) } -- 2.39.5