How can I drive TLC5947 with HSPI?
Posted: Fri Feb 08, 2019 6:24 am
Hello, I'm trying to make a Adfruit TLC5947 module work with NodeMCU board,
Adfruit_TLC5947 library works fine but it's too slow, so I think hardware spi will be better,
so I typed this after readed TLC5947 spec.,
as expected, the first led attached wound light up, but it did not.
what's the right solution? have you some experience? thanks for suggestions.
Adfruit_TLC5947 library works fine but it's too slow, so I think hardware spi will be better,
so I typed this after readed TLC5947 spec.,
Code: Select all
#include <Arduino.h>
#include <SPI.h>
#define latch 5
void setup() {
Serial.begin(115200);
Serial.println("TLC5974 test");
SPI.begin();
}
void loop() {
int thisTime = millis();
uint8_t buffer[36] = {0xFF, 0x0F};
digitalWrite(latch, 1);
SPI.beginTransaction(SPISettings(SPI_CLOCK_DIV16,MSBFIRST, SPI_MODE0));
SPI.writeBytes(buffer, 36);
digitalWrite(latch, 0);
Serial.println(millis() - thisTime);
delay(200);
}
as expected, the first led attached wound light up, but it did not.
what's the right solution? have you some experience? thanks for suggestions.