Skip to content

Commit

Permalink
adding esp32s3 suppport
Browse files Browse the repository at this point in the history
  • Loading branch information
Yves BAZIN authored and Yves BAZIN committed Nov 20, 2024
1 parent 7a7a39c commit 056e556
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 15 deletions.
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,23 @@ Thanks to the ESP32 LCD driver being faster you can overclock the leds output (w
* `void initled((uint8_t*)leds,pins,CLOCK_PIN,LATCH_PIN,clock_speed clock)`

Here are the possible values
* `clock_800KHZ` : default value
* `clock_1000KHZ` : works really fine
* `clock_1111KHZ` : depending on your boards
* `clock_1123KHZ` : the max I manage to get
* `clock_800KHZ` : default value
* `clock_1000KHZ` : works really fine
* `clock_1111KHZ` : depending on your boards
* `clock_1123KHZ` : the max I manage to get

example:
`driver.initled(pins,CLOCK_PIN,LATCH_PIN,clock_1111KHZ)`
```C
#include "I2SClocklessVirtualLedDriver.h"

I2SClocklessVirtualLedDriver driver;

Pixel leds[NUM_STRIPS*NUM_LEDS_PER_STRIP];
int pins[NBIS2SERIALPINS] ={14, 12, 13, 25};
driver.initled((uint8_t*)leds,pins,CLOCK_PIN,LATCH_PIN,clock_1111KHZ);
```
```C
Pixel led1[NUM_LEDS];
Expand Down
14 changes: 13 additions & 1 deletion examples/gettingstarted/gettingstarted.ino
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
#define NBIS2SERIALPINS 6 // the number of virtual pins here mavimum 6x8=48 strips
#define NUM_LEDS_PER_STRIP 256
#define NUM_LEDS (NUM_LEDS_PER_STRIP * NBIS2SERIALPINS * 8)
#ifdef CONFIG_IDF_TARGET_ESP32S3
#define LATCH_PIN 46
#define CLOCK_PIN 3
#else

#define LATCH_PIN 27
#define CLOCK_PIN 26
#endif

#ifdef CONFIG_IDF_TARGET_ESP32S3
int Pins[6] = {9, 10,12,8,18,17};
#else
int Pins[6] = {14, 12, 13, 25, 33, 32};
#endif
#define NUM_STRIPS (NBIS2SERIALPINS * 8)
#include "I2SClocklessVirtualLedDriver.h"
Pixel leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];

int Pins[6] = {14, 12, 13, 25, 33, 32};


I2SClocklessVirtualLedDriver driver;
void setup()
Expand Down
14 changes: 13 additions & 1 deletion examples/gettingstartedFastLED/gettingstartedFastLED.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,24 @@
#define NUM_STRIPS (NBIS2SERIALPINS * 8)
#define USE_FASTLED
#include "I2SClocklessVirtualLedDriver.h"
#ifdef CONFIG_IDF_TARGET_ESP32S3
#define LATCH_PIN 46
#define CLOCK_PIN 3
#else

#define LATCH_PIN 27
#define CLOCK_PIN 26
#endif

#ifdef CONFIG_IDF_TARGET_ESP32S3
int Pins[6] = {9, 10,12,8,18,17};
#else
int Pins[6] = {14, 12, 13, 25, 33, 32};
#endif
// here we have 3 colors per pixel
CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];

int Pins[6] = {14, 12, 13, 25, 33, 32};


I2SClocklessVirtualLedDriver driver;
void setup()
Expand Down
12 changes: 12 additions & 0 deletions examples/pixelpush/pixelpush.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,22 @@
#define NUM_STRIPS (NBIS2SERIALPINS * 8)
#define I2S_MAPPING_MODE I2S_MAPPING_MODE_OPTION_DIRECT_CALCULATION
#include "I2SClocklessVirtualLedDriver.h"
#ifdef CONFIG_IDF_TARGET_ESP32S3
#define LATCH_PIN 46
#define CLOCK_PIN 3
#else

#define LATCH_PIN 27
#define CLOCK_PIN 26
#endif

#ifdef CONFIG_IDF_TARGET_ESP32S3
int Pins[6] = {9, 10,12,8,18,17};
#else
int Pins[6] = {14, 12, 13, 25, 33, 32};
#endif



I2SClocklessVirtualLedDriver driver;

Expand Down
10 changes: 10 additions & 0 deletions examples/pixelpushwithpalette/pixelpushwithpalette.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,20 @@
#define _USE_PALETTE
#define USE_FASTLED // to have the CHSV mapping
#include "I2SClocklessVirtualLedDriver.h"
#ifdef CONFIG_IDF_TARGET_ESP32S3
#define LATCH_PIN 46
#define CLOCK_PIN 3
#else

#define LATCH_PIN 27
#define CLOCK_PIN 26
#endif

#ifdef CONFIG_IDF_TARGET_ESP32S3
int Pins[6] = {9, 10,12,8,18,17};
#else
int Pins[6] = {14, 12, 13, 25, 33, 32};
#endif

I2SClocklessVirtualLedDriver driver;

Expand Down
20 changes: 16 additions & 4 deletions examples/secondcore/secondcore.ino
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,23 @@
#define NUM_STRIPS (NBIS2SERIALPINS * 8)
#define USE_FASTLED
#include "I2SClocklessVirtualLedDriver.h"
#define _LATCH_PIN 27
#define _CLOCK_PIN 26
Pixel leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];
#ifdef CONFIG_IDF_TARGET_ESP32S3
#define LATCH_PIN 46
#define CLOCK_PIN 3
#else

#define LATCH_PIN 27
#define CLOCK_PIN 26
#endif

#ifdef CONFIG_IDF_TARGET_ESP32S3
int Pins[6] = {9, 10,12,8,18,17};
#else
int Pins[6] = {14, 12, 13, 25, 33, 32};
#endif
Pixel leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];


uint16_t mapfunction(uint16_t pos)
{
int panelnumber = pos / 256;
Expand Down Expand Up @@ -42,7 +54,7 @@ void setup()
{
Serial.begin(115200);

driver.initled(leds, Pins, _CLOCK_PIN, _LATCH_PIN);
driver.initled(leds, Pins, CLOCK_PIN, LATCH_PIN);
driver.setBrightness(20);
driver.setMapLed(&mapfunction);
delay(2000);
Expand Down
20 changes: 16 additions & 4 deletions examples/waitnowaitmode/waitnowaitmode.ino
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,23 @@
#define NUM_STRIPS (NBIS2SERIALPINS * 8)
#define USE_FASTLED
#include "I2SClocklessVirtualLedDriver.h"
#define _LATCH_PIN 27
#define _CLOCK_PIN 26
Pixel leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];
#ifdef CONFIG_IDF_TARGET_ESP32S3
#define LATCH_PIN 46
#define CLOCK_PIN 3
#else

#define LATCH_PIN 27
#define CLOCK_PIN 26
#endif

#ifdef CONFIG_IDF_TARGET_ESP32S3
int Pins[6] = {9, 10,12,8,18,17};
#else
int Pins[6] = {14, 12, 13, 25, 33, 32};
#endif
Pixel leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];


uint16_t mapfunction(uint16_t pos)
{
int panelnumber = pos / 256;
Expand Down Expand Up @@ -42,7 +54,7 @@ void setup()
{
Serial.begin(115200);

driver.initled(leds, Pins, _CLOCK_PIN, _LATCH_PIN);
driver.initled(leds, Pins, CLOCK_PIN, LATCH_PIN);
driver.setBrightness(20);
driver.setMapLed(&mapfunction);
delay(2000);
Expand Down

0 comments on commit 056e556

Please sign in to comment.