Friday, August 28, 2020

Arduino Onboard Status LEDs

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.
  1. Power LED
  2. Status LED on pin 13
  3. RX status Serial LED on pin 0
    • Receiving data
  4. 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


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"

Software communication to Arduino not using Arduino C++:


No comments:

Post a Comment

Arduino and pump

Motor Driver witn 9110 or 9110S  https://www.laskakit.cz/user/related_files/l9110_2_channel_motor_driver.pdf https://docs.sunfounder.com/pro...