Arduino libraries
Arduino libraries with examples that run in your browser
446 Arduino libraries are built into Mokxi, so a sketch that includes one compiles with nothing to install. These 100 have a page of their own: the calls a sketch uses, the wiring, the errors people hit and an example that opens in the editor and runs.
No library page matches that. The editor’s library browser lists every built-in library.
Motion
- ServoServo.hAttach, write, writeMicroseconds, read and detach, on any pin
- StepperStepper.hSetSpeed and step for the 28BYJ-48 and its ULN2003 board
- AccelStepperAccelStepper.hAcceleration and speed for steppers on a driver, two, three or four wires, or the sketch’s own step functions, and MultiStepper to move several together
- Adafruit PWM Servo Driver LibraryAdafruit_PWMServoDriver.hThe PCA9685’s sixteen PWM channels, for servos and LEDs
- Adafruit Motor Shield V2 LibraryAdafruit_MotorShield.hFour DC motors or two steppers through the V2 shield’s PCA9685 and TB6612s
- L298NL298N.hDC motors on an L298N: setSpeed(), forward(), backward(), stop() and the non-blocking forwardFor()
Core
- WireWire.hI2C as a master on the board’s usual SDA and SCL pins
- SPISPI.hTransfer and transactions on the board’s usual SPI pins
- EEPROMEEPROM.hRead, write, update, get, put and EEPROM[i]
- FreeRTOS (Arduino_FreeRTOS)Arduino_FreeRTOS.hTasks with stacks of their own that delay and wait on queues, semaphores, mutexes and task notifications, with loop() as the idle task
Communication
- SoftwareSerialSoftwareSerial.hA serial port on any two pins, for the HC-05, the GPS module, and RS-485 or RS-232 through a MAX485 module or a MAX232
- OneWireOneWire.hThe 1-Wire bus: reset, search, read and write, CRC8
- MFRC522MFRC522.hRFID cards: the UID, blocks read and written, value blocks, access bits, the magic-card UID calls and NTAG216 passwords
- RF24RF24.hNRF24L01 radios: pipes, acknowledgments and payloads between boards, the IRQ flags, and the examples’ printf.h
- LoRaLoRa.hSX1276/77/78 LoRa radios (Ra-02, RFM95W): packets between boards, polled or on DIO0, the spreading factor, bandwidth, sync word and CRC, and channel activity detection
- RadioLibRadioLib.hThe SX127x LoRa classes (SX1276, SX1278, RFM95, RFM96): transmit and receive, blocking or on DIO0, scanChannel and the modem settings
- TinyGPSPlusTinyGPS++.hNMEA sentences parsed into location, date, time, speed and satellites, and TinyGPSCustom for any other field
- BluetoothSerial (ESP32 core)BluetoothSerial.hThe classic ESP32’s Bluetooth serial port, SerialBT.begin("name"), the Stream calls, SSP pairing and register_callback() for SPP events
- DFRobotDFPlayerMiniDFRobotDFPlayerMini.hThe DFPlayer Mini MP3 module over serial: play, volume, folders and the replies
- BLE (ESP32 core)BLEDevice.hBluetooth LE servers, services, characteristics, advertising and scans, as the ESP32 BLE tutorials write them
- I2S (ESP32 core and ESP-IDF)ESP_I2S.hStandard (Philips and MSB) I2S in and out on any GPIO: I2SClass from ESP_I2S.h, the core 2.x I2S object, and the ESP-IDF legacy and standard-mode drivers, for I2S microphones and amplifiers
- TinyGPSTinyGPS.hTinyGPS++’s predecessor: encode(), f_get_position(), crack_datetime() and the speeds
- KeyboardKeyboard.hThe ATmega32U4 as a USB keyboard: Keyboard.begin(), print(), press() and releaseAll()
- MouseMouse.hThe ATmega32U4 as a USB mouse: Mouse.move(), click(), press() and release()
- Arduino Joystick LibraryJoystick.hThe ATmega32U4 as a USB game controller: buttons, axes and hat switches
- MIDI LibraryMIDI.hMIDI messages on a serial port: sendNoteOn() and the rest, read() with handlers, Thru, SysEx, RPN and NRPN, chained calls and custom transports
- ModbusMasterModbusMaster.hA Modbus RTU master: readHoldingRegisters(), writeSingleRegister() and the rest, with the CRC checked and the RS-485 direction callbacks
- i2cdetecti2cdetect.hI2cdetect() prints the Linux i2cdetect table of the addresses that answer, to Serial
- AltSoftSerialAltSoftSerial.hA second serial port on upstream’s fixed pins: RX 8 and TX 9 on the Uno, Nano and Pro Mini, 48 and 46 on the Mega, 13 and 5 on the Leonardo
Data and time
- SDSD.hFiles on a FAT16 card: open, print, read, exists, remove, mkdir and directory listings, and the CardInfo example’s Sd2Card, SdVolume and SdFile
- RTClibRTClib.hThe DS3231 and DS1307 clocks, with DateTime, TimeSpan, the DS3231’s alarms, and RTC_Millis and RTC_Micros
- TimerOneTimerOne.hTimer1 as a periodic interrupt, and PWM of any period on its pins
- MsTimer2MsTimer2.hA function every so many milliseconds, from Timer2
- Low-PowerLowPower.hPowerDown, idle and the other sleeps, for a period or until an interrupt
- ArduinoJsonArduinoJson.hJSON and MessagePack in and out: JsonDocument (and the 6.x Static and Dynamic documents, and the 5.x StaticJsonBuffer with parseObject() and printTo()), serializeJson and deserializeJson from text, a String, a Stream or a File, with the Filter option and serialized()
- TimeTimeLib.hA clock in software: setTime, now, hour, minute, makeTime, breakTime and a sync provider
- DS1307RTCDS1307RTC.hRTC.get, RTC.read and RTC.set on a DS1307 (or DS3231), with TimeLib.h
- Preferences (ESP32 core)Preferences.hNamed settings by key: putUInt, getString, putBytes and the rest, in namespaces
- I2C_EEPROMI2C_eeprom.hA 24LC256 or AT24C EEPROM: writeByte, writeBlock across pages, readBlock, objects, the verify calls, determineSizeNoWrite and the cyclic store
- DS3231 (NorthernWidget) and DS3231 (Rinky-Dink Electronics)DS3231.hThe DS3231 clock: getHour(h12, pm), RTClib::now() and alarms, or getTimeStr(), getDateStr() and setTime()
- QRCodeqrcode.hQR codes of versions 1 to 40 at the four error correction levels, read module by module to draw
- TimezoneTimezone.hLocal time from UTC with daylight-saving rules: TimeChangeRule, toLocal(), toUTC() and utcIsDST()
- SdFatSdFat.hSdFat and SdFs with begin(SdSpiConfig), File32 and FsFile with open(), println(), fileSize() and close(), and ls()
- PIDPID_v1.hThe PID controller of the temperature, speed and balance tutorials: Compute(), SetTunings() and SetOutputLimits()
- Arduino_JSONArduino_JSON.hJSONVar, JSON.parse(), JSON.stringify() and JSON.typeof(), as the ESP32 web tutorials use them
- TickerTicker.hCallbacks every interval, a number of times or for ever, from update() in loop(): start(), pause(), resume(); on the ESP32 and ESP8266 boards also the cores’ own Ticker, attach(seconds, function), once() and detach()
- MadgwickMadgwickAHRS.hMadgwick’s orientation filter: begin(rate), updateIMU() or update() with a magnetometer, then getRoll(), getPitch() and getYaw()
Displays
- LiquidCrystalLiquidCrystal.hThe 16x2 and 20x4 character LCD on six (or ten) wires, every kit’s first display
- LiquidCrystal I2CLiquidCrystal_I2C.hThe character LCD behind its PCF8574 I2C backpack
- Adafruit GFX LibraryAdafruit_GFX.hText in the built-in font or a GFXfont, pixels, lines, rectangles, circles, ellipses, triangles, bitmaps, canvases and buttons on every Adafruit display
- Adafruit SSD1306Adafruit_SSD1306.hThe 128x64 and 128x32 I2C OLEDs
- U8g2U8g2lib.hSSD1306, SSD1309, SH1106, SH1107 and PCD8544 displays: full and page buffers in upstream's layout, shapes, bitmaps, text in four directions, buttons, U8x8, the logs and the user interface screens
- Adafruit ILI9341Adafruit_ILI9341.hThe 2.8 inch 320x240 SPI TFT
- GxEPD2GxEPD2_BW.hThe 2.13 and 2.9 inch black and white e-paper panels, drawn in pages
- LedControlLedControl.hMAX7219 8x8 matrices and eight-digit displays
- TFT_eSPITFT_eSPI.hILI9341, ST7789, ST7735, GC9A01, ILI9488 (18-bit color, as upstream sends it over SPI) and ST7796 TFTs: shapes, anti-aliased arcs, circles and wide lines, the numbered, free and smooth (.vlw) fonts, viewports, sprites at 1, 4, 8 and 16 bits with rotation, buttons and XPT2046 touch
- MD_MAX72XXMD_MAX72xx.hChains of 8x8 matrix modules: points, columns, rows, lines, characters in upstream’s font tables, shifts and transforms
- TM1637TM1637Display.hThe four-digit clock display: numbers, the colon, raw segments and brightness
- SevSegSevSeg.hA multiplexed seven-segment display straight from the pins: numbers, decimals and letters
- U8glibU8glib.hU8g2's predecessor, as older OLED tutorials use it: SSD1306, SSD1309, SH1106 and PCD8544 constructors, the firstPage() and nextPage() loop, shapes, bitmaps, text in four directions, the cursor and the color calls
- hd44780hd44780.hThe extensible LCD library: hd44780_I2Cexp finds the backpack’s address itself, and hd44780_pinIO drives a bare module
- LCD_I2CLCD_I2C.hThe I2C LCD as LCD_I2C lcd(0x27, 16, 2), begin() and backlight()
Input
- XPT2046_TouchscreenXPT2046_Touchscreen.hThe resistive touch layer on the ILI9341, ILI9488 and ST7796 modules
- Adafruit MCP23017 Arduino LibraryAdafruit_MCP23X17.hSixteen more pins over I2C, and the eight-pin MCP23008’s class
- CapacitiveSensorCapacitiveSensor.hTouch sensing with a send pin, a resistor and a receive pin, the library’s own count
- KeypadKeypad.hMatrix keypads: getKey, several keys at once, hold and release events
- IRremoteIRremote.hEvery protocol of IRremote 4.6, received and sent (NEC, Samsung, Sony, RC5, RC6, Panasonic, LG, JVC, Denon and the rest), the universal pulse distance decoder, the printouts, TinyIR, the command dispatcher and the 2.x irrecv.decode(&results)
- EncoderEncoder.hQuadrature encoder counts, four per cycle, on interrupts where the pins have them
- OneButtonOneButton.hClick, double click, multi click and long press from one button, and the reduced OneButtonTiny class
- PCF8574 (Rob Tillaart) and PCF8574 library (Renzo Mischianti)PCF8574.hEight more pins over I2C: read8, write and toggle, or pinMode, digitalWrite and digitalRead on P0 to P7
- RotaryEncoderRotaryEncoder.hA rotary encoder polled with tick(): getPosition(), getDirection() and the three latch modes
- CD74HC4067CD74HC4067.hCD74HC4067 mux(s0, s1, s2, s3) and channel(n), to read sixteen inputs on one analog pin
LEDs
- Adafruit NeoPixelAdafruit_NeoPixel.hWS2812 strips, rings and panels
- FastLEDFastLED.hCRGB arrays and CRGBArray sets, CHSV, palettes, fill_rainbow, noise, HeatColor, beatsin8, EVERY_N_MILLISECONDS and RGBW strips
- Arduino_LED_Matrix (Uno R4 core)Arduino_LED_Matrix.hThe Uno R4 WiFi’s 12 by 8 LED matrix: frames, renderBitmap and sequences
Sensors
- DHT sensor libraryDHT.hThe DHT11 and DHT22: temperature, humidity and the heat index, and DHT_Unified
- DallasTemperatureDallasTemperature.hDS18B20 thermometers, any number on one pin
- Adafruit BMP280 LibraryAdafruit_BMP280.hTemperature, pressure and altitude
- Adafruit MPU6050Adafruit_MPU6050.hAcceleration in m/s², rotation in rad/s and temperature, as unified sensor events
- MPU6050MPU6050.hThe raw accelerometer and gyro counts, ranges and offsets
- Adafruit INA219Adafruit_INA219.hCurrent, bus voltage and power
- Adafruit ADS1X15Adafruit_ADS1X15.hThe ADS1115’s four 16-bit inputs, single or differential
- HX711 Arduino LibraryHX711.hThe load cell amplifier: tare, set_scale and get_units
- BH1750BH1750.hAmbient light in lux
- MAX6675 librarymax6675.hA K-type thermocouple in Celsius or Fahrenheit, NAN when the probe is open
- VL53L0XVL53L0X.hTime-of-flight distance in millimeters, single or continuous
- Adafruit_VL53L0XAdafruit_VL53L0X.hTime-of-flight distance with rangingTest(), readRange() and startRange(), continuous ranging, the sensing profiles and the new-measurement interrupt on GPIO1
- UltrasonicUltrasonic.hHC-SR04 distance in centimeters or inches, on two pins or one
- NewPingNewPing.hHC-SR04 distance in centimeters or inches, and the median of several pings
- ADS1X15ADS1X15.hADS1115 ADS(0x48): readADC(), the differential reads, setGain(), toVoltage() and requestADC() with isReady()
- BME280BME280I2C.hBME280I2C: read(pres, temp, hum, ...) in any unit, the settings, and EnvironmentCalculations’ altitude, dew point and heat index
- DHT20DHT20.hThe I2C DHT20: begin(), read(), getHumidity() and getTemperature(), or requestData() and readData() in steps
- ACS712ACS712.hAn ACS712 current sensor’s output in milliamps: ACS712 ACS(A0, 5.0, 1023, 185), autoMidPoint(), mA_DC(), mA_AC() and mA_peak2peak()
- ZMPT101BZMPT101B.hThe ZMPT101B AC voltage sensor’s RMS voltage: ZMPT101B sensor(A0, 50.0), setSensitivity() and getRmsVoltage()
Network
- WiFi, HTTPClient and WebServer (ESP32 core)WiFi.hJoin the simulated access point, fetch pages with HTTPClient and serve the editor’s Web panel with WebServer or WiFiServer
- PubSubClientPubSubClient.hMQTT publish and subscribe over a WiFiClient
- ThingSpeakThingSpeak.hWriteField(), setField() with writeFields(), and the read calls, as HTTP requests
- BlynkBlynkSimpleEsp8266.hBlynk.begin(), run(), virtualWrite(), syncVirtual(), logEvent(), BLYNK_WRITE with param, BLYNK_CONNECTED, BlynkTimer and the LED, terminal and LCD widgets, on a simulated Blynk server
- MQTTMQTT.hMQTTClient: begin(), connect(), publish(), subscribe() and loop()
- WiFiManagerWiFiManager.hAutoConnect(), startConfigPortal(), WiFiManagerParameter and the settings calls
Every library, already installed
All 446 built-in libraries are in the editor’s library browser, each with an example to open.