Arduino Uno Tutorial 1: Installing Arduino IDE
Arduino Uno Tutorial 2: Arduino Uno Development Board and LED Testing
(1) IntroductionWhen we first get a board, we usually perform a LED test to check if the board is functioning properly and to familiarize ourselves with the pins and capabilities of the board. There are many models of Arduino, and in this issue, we will explore the most common one, the Arduino Uno.(2) Arduino Uno
Performance Parameters1. Main control chip: ATmega328P 2. Digital I/O pins: 14 3. PWM pins: 6 4. Storage (code storage space): 32KB 5. RAM (runtime storage): 2KB; EEPROM (power-off storage): 1KB 6. Oscillator: 16MHzLighting Up an LED
1. First, locate the LED on the board. It is usually mentioned in the manual or labeled on the board. The onboard LED for Arduino Uno is on pin 13, which lights up when the signal is high and turns off when the signal is low.
2. We need to understand the corresponding functions to light up the LED.
pinMode(pin, mode); used to set the working mode of a pinINPUT: Sets the specified pin to input mode for receiving external signals or sensor data.
INPUT_PULLUP: Sets the pin to an internal pull-up input mode. In this mode, the pin is connected to an internal pull-up resistor, keeping the floating pin in a high state. When the external signal is low, the reading switches to LOW.
OUTPUT: Sets the specified pin to output mode for sending electrical signals or controlling external devices. In this mode, the pin can output high (HIGH) or low (LOW) signals. It can be used to drive LEDs, relays, and other external devices.
INPUT_PULLDOWN: Sets the pin to an internal pull-down input mode. In this mode, Arduino connects a resistor to ground at the input, ensuring that the input is always in a low state. When the external circuit is not connected or in a high impedance state, the Arduino input pin remains in a low state.
digitalWrite(pin, value); sets a digital pin to high or low
value is HIGH or LOW. HIGH indicates high level, LOW indicates low level.
// Initialization function void setup() { pinMode(13, OUTPUT); // Set pin 13 (LED) to output mode } // Loop function void loop() { digitalWrite(13, HIGH); // Write high to pin 13 delay(1000); // Delay 1 second digitalWrite(13, LOW); // Write low to pin 13 delay(1000); // Delay 1 second }
setup function: sets pin 13 to output mode. loop function: sets pin 13 to high (LED on), delays for 1 second, sets pin 13 to low (LED off), delays for 1 second.
The LED on pin 13 blinks at a rate of 1Hz.
Free Application for Development Board

Submission/Promotion/Collaboration/Join Group Please scan to add WeChat
(Please note your intention, for joining groups please specify city-name-industry position information)