Arduino has 4 Onboard LEDs. Three have pins associated with them, which can be useful.
Below are tutorials to understand and use these onboard LEDs and associated pins and features.
- Power LED
- Status LED on pin 13
- RX status Serial LED on pin 0
- Receiving data
- TX status Serial LED on pin 1
- Transmitting data
Arduino Onboard embedded LEDs
Overview
1. Onboard Power green LED
This green LED is hardwired to be on if the Arduino has power, so there is no software control.
2. Status LED on pin 13
LED_BUILTIN is set to 13
How to blink LED 13
- Arduino Tutorial 1: Setting Up and Programming the Arduino for Absolute Beginners
- start at time 11:15
- good explanation
3./4. RX/TX LEDs
Short version:
Serial input here is a kind of CLI (command line interface) using
- Serial.begin(<baudRate>)
- Serial.println(...) for debug
- Serial.write(...) for input
Arduino Tutorial #4: Serial Communication
Understanding Serial use and when TX/RX LEDs light-up
Summary :
- regular setup,
- Serial.begin(9600); // in: baud rate
- serial input/output
- x = Serial.read(...); // in: what writing like '1' or "Hello" or variable like x
- reads in
- Serial.print(...); // x, the value of variable or '1' or
- used for a lot for debugging
- what LEDs light up on the Arduino itself.
- rx/tx LEDs behind the USB port
Also see Arduino Reference for Serial class: here
Raspberry Pi - Arduino Serial Communication
- Communicates over USB cable
- Be use to check the GPIO pins match the Raspberry PI you are using.
More advanced ideas for using Arduino serial communication
Here are ideas on how to explore more advanced ways to serial communication for your projects:
Search "Communicating between 2 Arduinos" from arduino.cc/reference
- see Project Hub results
Google "Communicating between 2 Arduinos"
- May use USB and may be wired. There are many results in forums like StackExchange.
- However is a fairly clear HowTo link:
- https://iot-guider.com/arduino/serial-communication-between-two-arduino-boards/
Software communication to Arduino not using Arduino C++:
- Example for javascript (see answers)











