- I’ve uploaded the code with VS Code/Platformio
- LED blinks as expected
- After a power cycle (unplugging and plugging it back in) it is not blinking
- after uploading it again it will work again as expected until I power cycle
- it is working when the code is uploaded with Arduino IDE (also after a power cycle)
So why is the upload via platformio not power cycle “resistant”?
Has anyone an idea what is happening here?
Here is the code I’ve used:
platformio.ini
[env:teensylc]
platform = teensy
board = teensylc
framework = arduino
build_flags = -D USB_MIDI
lib_deps = Wire
main.cpp
#include <Arduino.h>
#include "led.h"
LED led;
void setup()
{
led.begin();
}
void loop()
{
led.an1();
delay(1000);
led.aus1();
delay(1000);
}
led.cpp
#include "Arduino.h"
#include "led.h"
Adafruit_TLC59711 tlc = Adafruit_TLC59711(NUM_TLC59711, clock, data);
LED::LED()
{
}
void LED::an1()
{
tlc.setLED(0, 30000, 30000, 0); // LED Number, Red, Green, Blue
tlc.write();
}
void LED::aus1()
{
tlc.setLED(0, 0, 0, 0); // LED Number, Red, Green, Blue
tlc.write();
}
void LED::begin()
{
tlc.begin();
tlc.write();
}
led.h
#ifndef led_h
#define led_h
#include "Arduino.h"
#include <Adafruit_TLC59711.h>
#include <SPI.h>
#define data 10 // Data Pin
#define clock 11 // Clock Pin
#define NUM_TLC59711 1 // How many boards do you have chained?
class LED
{
public:
LED();
void an1();
void aus1();
void begin();
private:
};
#endif