Arduino, as a very popular open-source hardware and software platform, owes its powerful functionality to the rich libraries provided officially. These libraries offer pre-written codes that allow easy control of various hardware components to achieve various functions. This article will delve into Arduino’s official libraries, guiding you to explore the Arduino world and kickstart your creative journey!
Robot-Related Libraries
Want to make your project come alive? Arduino provides rich libraries that allow your Arduino to control various motors and achieve various robotic movements.
Servo Library: Specifically designed to control servos. A servo is a type of motor that can rotate to a certain angle, widely used in robotic arms and various model making. The Servo library offers easy-to-use functions like attach()
, write()
, and read()
, allowing you to easily set the angle of the servo and obtain the current angle.
Stepper Library: Focused on controlling stepper motors. Stepper motors are motors that can precisely control rotation angles, making them ideal for controlling the motion path of robots. The Stepper library provides setSpeed()
and step()
functions to set the speed and rotation steps of the stepper motor.
Communication
The core advantage of Arduino lies in its ability to communicate with various devices and sensors. Arduino provides powerful libraries that allow you to easily implement various communication protocols.
SPI Library: Used for communication with other devices via the Serial Peripheral Interface (SPI) bus. SPI is a high-speed communication protocol suitable for communication with various peripherals, such as sensors, displays, and memory. The SPI library provides the transfer()
function for conveniently sending and receiving data.
Wire Library: Used for communication via the Two Wire Interface (TWI/I2C) bus. I2C is a commonly used communication protocol suitable for communication with various sensors, real-time clocks, and memory. The Wire library provides functions like beginTransmission()
, requestFrom()
, and endTransmission()
, making communication easy.
SoftwareSerial Library: Used to implement serial communication on any digital pin. If your Arduino board does not have a built-in serial port or you need to use multiple serial ports, the SoftwareSerial library comes in handy.
Connectivity
The power of Arduino lies in its ability to connect to the internet, becoming an Internet of Things (IoT) device to achieve various remote control and data collection functions. Arduino provides rich libraries that allow you to easily connect to the network.
ArduinoIoTCloud Library: Used to connect to the Arduino IoT Cloud service. Arduino IoT Cloud provides a cloud platform that allows you to easily store and manage your device data and develop various applications.
ArduinoBLE Library: Used for Bluetooth Low Energy (BLE) technology on some Arduino boards. BLE is a low-power wireless communication protocol suitable for communication with smartphones and other BLE devices.
Ethernet Library: Used to connect to the internet via Ethernet.
GSM Library: Used to connect to the internet via GSM/GRPS networks.
MKRWAN Library: Used for MKR WAN 1300/1310 boards to connect to LoRaWAN® networks. LoRaWAN® is a low-power wide-area network (LPWAN) technology suitable for IoT applications.
MKRGSM Library: Used for MKR GSM 1400 boards to connect to GSM/GPRS networks.
MKRNB Library: Used for MKR NB 1500 boards to connect to NB-IoT / Cat M1 networks.
SigFox Library: Used for MKR FOX 1200 boards to connect to Sigfox networks.
WiFi Library: Used to connect to the internet via Wi-Fi Shield.
WiFi101 Library: Used for MKR 1000 WiFi and WiFi101 Shield to connect to the internet via Wi-Fi.
WiFiNINA Library: Used for Arduino boards with Wi-Fi NINA modules to connect to the internet via Wi-Fi.
Nano Series Libraries
Arduino Nano series boards come with various built-in sensors, making it easy for you to develop various projects.
ArduinoAPDS9960 Library: Used to work with the APDS9960 gesture sensor. The APDS9960 can recognize gestures, colors, ambient light, and distance.
Arduino_LSM6DS3 Library: Used with the LSM6DS3 6-axis IMU, which is present on Arduino Nano 33 IoT and Arduino UNO WiFi Rev. 2. The IMU is used to measure acceleration and angular velocity.
Arduino_LSM9DS1 Library: Used with the LSM9DS1 9-axis IMU, which is present on Arduino Nano 33 BLE and Arduino Nano 33 BLE Sense. The IMU is used to measure acceleration, angular velocity, and magnetic field strength.
Arduino_LSM6DSOX Library: Used with the LSM6DSOX 6-axis IMU, which is present on Arduino Nano RP2040 Connect.
ArduinoLPS22HB Library: Used with the LPS22 barometer and temperature sensor. The LPS22 is a super small sensor capable of measuring pressure and temperature.
ArduinoHTS221 Library: Used with the HTS221 relative humidity and temperature sensor.
PDM Library: Used with the MP34DT05 digital microphone (on Nano BLE Sense and Nano RP2040 Connect).
Memory
Arduino provides various libraries to help you store and manage data.
EEPROM Library: Used for reading and writing to permanent storage (EEPROM). EEPROM is a non-volatile memory that can retain data even when the Arduino is powered off.
SD Library: Used for reading and writing to SD cards. SD cards are removable storage devices that can store a large amount of data.
Display
Arduino can control various displays, allowing you to showcase various information.
LiquidCrystal Library: Used to control LCD (Liquid Crystal Display). LCDs are common displays that can show text and graphics.
TFT Library: Used to draw text, images, and shapes on Arduino TFT screens. TFT is a color display that can show richer content.
MKR Series Libraries
Arduino MKR series products are designed specifically for IoT applications, providing a range of unique libraries.
Scheduler Library: Used to manage multiple non-blocking tasks (also applicable to Arduino Due). The Scheduler library allows you to execute multiple tasks without blocking the main program.
RTCZero Library: Used to implement a real-time clock (RTC) that can be used to schedule events. The RTC can keep track of time even when the Arduino is powered off.
ArduinoMKRGPS Library: Used with the Arduino MKR GPS Shield. This shield can receive GPS signals and obtain location information.
ArduinoMKRRGB Library: Used with the Arduino MKR RGB Shield. This shield can control RGB LEDs to achieve various lighting effects.
ArduinoGraphics Library: Used to draw graphics, also applicable to the Arduino MKR RGB Shield. This library provides functions to draw various graphic elements.
ArduinoRS485 Library: Used to implement RS485 protocol on the Arduino MKR RS485 Shield. RS485 is a differential signal transmission protocol suitable for long-distance communication.
ArduinoMKRENV Library: Used to read all sensors on the Arduino MKR ENV Shield. This shield contains various sensors that can measure temperature, humidity, pressure, and other environmental parameters.
ArduinoMKRTHERM Library: Used to read sensors connected to the Arduino MKR THERM Shield. This shield can connect various sensors to measure temperature and other parameters.
MKRIMU Library: Used to read acceleration, gyroscope, magnetic field, and Euler angle data from the IMU on the MKR IMU Shield. This shield can measure motion information for various applications, such as robot navigation.
ArduinoMotorCarrier Library: Used to control MKR/Nano Motor Carriers. This library can control motors for various robotic applications.
Arduino_MKRIoTCarrier Library: Used to control the MKR IoT Carrier. This library can control various sensors and actuators for IoT applications.
Audio
Arduino can play audio to achieve various sound effects.
AudioFrequencyMeter Library: Used to capture audio signals and obtain frequency.
AudioZero Library: Used to play audio files from an SD card.
ArduinoSound Library: Used to play and analyze audio data easily.
Audio Library: Used to play audio files from an SD card (only for Arduino DUE).
I2S Library: Used to use I2S protocol on SAMD21 (included in SAMD platform). I2S is a communication protocol for audio data.
USB
Arduino can act as a USB host or device to communicate with other USB devices.
USBHost Library: Used to communicate with USB peripherals (such as mice and keyboards).
Keyboard Library: Used to send key information to connected computers.
Mouse Library: Used to control the mouse cursor on connected computers.
Others
Firmata Library: Used to communicate with applications on computers through standard serial protocols.
Conclusion
Arduino’s official libraries provide limitless possibilities for your creativity. You can use these libraries to quickly build various projects, from simple LED control to complex robotic control, all easily achievable. By continuously exploring these libraries, you will find that the world of Arduino is full of infinite surprises!
Leave a Comment
Your email address will not be published. Required fields are marked *