A few observations:
- the PurpleLED struct isn’t specified for a white value. That might be confusing. Maybe try setting ‘Green’ to 0.
- The MaxVolts and P2Volts are the same which isn’t right and could lead to a division by zero in the code. (I’m not going to dive too deep into this, keep reading to find out why…)
- The LED struct logic assumes that your LED is powered by the battery and isn’t really helpful when powering the LED from a fixed power source like the 3.3v pad. So really we should just nerf all these values.
- Read this: Recommended way to post a config file
Anyways, here is what I suggest trying:
struct PurpleLED {
static constexpr float MaxAmps = 0.02;
static constexpr float MaxVolts = 30.0; // nerf it because we're powered by 3.3v
static constexpr float P2Amps = 0.10;
static constexpr float P2Volts = 3.0;
static constexpr float R = 220; // Resistor value
static const int Red = 255;
static const int Green = 0;
static const int Blue = 255;
};
Now if that doesn’t work, we’ll have to look at the styles to see if maybe they are the wrong color?