Skip to content

tedlanghorst/LP5562

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arduino LP5562 LED Driver Library

An Arduino library for controlling the Texas Instruments LP5562 4-channel I2C LED driver.

Description

This library allows you to easily control the brightness (PWM) and maximum current for the four individual LED channels (typically Red, Green, Blue, and White) of the LP5562 chip via I2C communication. It supports basic configuration like setting the dimming curve (linear/logarithmic) and PWM frequency.

Features

  • Initialize the LP5562 driver.
  • Set brightness (0-255) for individual R, G, B, W channels.
  • Set maximum current (0-25.5mA) for individual R, G, B, W channels.
  • Configure logarithmic or linear dimming.
  • Configure PWM frequency (256Hz or 558Hz).
  • Hardware Reset via command.

Installation

  1. Open the Arduino IDE.
  2. Go to Sketch > Include Library > Manage Libraries...
  3. Search for "LP5562".
  4. Click Install.

Alternatively, download the repository as a ZIP file and install it via Sketch > Include Library > Add .ZIP Library...

Wiring

Connect the LP5562 to your Arduino:

  • SDA -> Arduino SDA pin
  • SCL -> Arduino SCL pin
  • VDD -> 3.3V or 5V (refer to datasheet [cite: 37])
  • GND -> Arduino GND
  • EN/VCC -> 1.8V to VDD (Logic level reference, e.g., 3.3V for most Arduinos [cite: 37])
  • ADDR SEL0/1 -> GND or EN/VCC to set I2C address (GND/GND = 0x30 default) [cite: 317, 319]
  • R, G, B, W -> Connect to your LEDs (usually through current-limiting resistors if needed, though the chip provides current control).

Consult the LP5562 datasheet for full details. [cite: 1]

Basic Usage

#include <Wire.h>
#include <LP5562.h>

LP5562 ledDriver;

void setup() {
  ledDriver.begin()

  // Set max current (e.g., 10mA = value 100)
  ledDriver.setRGBWCurrent(100, 100, 100, 100);
}

void loop() {
  // Set Red
  ledDriver.setRGBWBrightness(255, 0, 0, 0);
  delay(500);
  // Set Green
  ledDriver.setRGBWBrightness(0, 255, 0, 0);
  delay(500);
  // Set Blue
  ledDriver.setRGBWBrightness(0, 0, 255, 0);
  delay(500);
   // Set White
  ledDriver.setRGBWBrightness(0, 0, 0, 255);
  delay(500);
}

About

Arduino library for the TI LP5562 4-channel LED driver

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages