This commit is contained in:
Lurkars 2020-12-28 19:21:34 +01:00
parent c22afeba26
commit 1f4be5f0d4

View File

@ -12,7 +12,7 @@ const uint8_t clockPin = 11;
// Create an object for writing to the LED strip. // Create an object for writing to the LED strip.
APA102<dataPin, clockPin> ledStrip; APA102<dataPin, clockPin> ledStrip;
const uint16_t ledCount = 56; const uint16_t ledCount = 28;
const uint8_t brightness = 1; const uint8_t brightness = 1;
const rgb_color RED = rgb_color(255, 0, 0); const rgb_color RED = rgb_color(255, 0, 0);
const rgb_color GREEN = rgb_color(0, 255, 0); const rgb_color GREEN = rgb_color(0, 255, 0);
@ -25,7 +25,6 @@ rgb_color colors[ledCount];
float passed = 0; float passed = 0;
int state = 0; int state = 0;
void setup() void setup()
{ {
Serial.begin(115200); Serial.begin(115200);
@ -39,6 +38,7 @@ void loop()
bool change = false; bool change = false;
while (count < ROUND_COUNT) while (count < ROUND_COUNT)
{ {
// check HALL if turned
if (digitalRead(HALL_PIN) == LOW) if (digitalRead(HALL_PIN) == LOW)
{ {
if (!change) if (!change)
@ -52,6 +52,7 @@ void loop()
change = false; change = false;
} }
// calc led for last turn
float current_diff = micros() - start; float current_diff = micros() - start;
for (int i = 0; i < state_count; i++) for (int i = 0; i < state_count; i++)