Refactored serial arduino devices. Created custom structs for sending data to arduino devices.

This commit is contained in:
Paul Dino Jones
2024-03-05 04:51:49 +00:00
parent 150c53c14b
commit f1ad4f5f91
9 changed files with 138 additions and 15 deletions
+3 -7
View File
@@ -1,7 +1,7 @@
#include <FastLED.h>
#include "simdata.h"
#define SIMDATA_SIZE sizeof(SimData)
#define SIMDATA_SIZE sizeof(ShiftLightsData)
#define LED_PIN 7
#define NUM_LEDS 6
@@ -39,11 +39,8 @@ void setup()
}
FastLED.clear();
sd.rpms = 0;
sd.rpm = 0;
sd.maxrpm = 6500;
sd.altitude = 10;
sd.pulses = 40000;
sd.velocity = 10;
}
void loop()
@@ -55,9 +52,8 @@ void loop()
{
Serial.readBytes(buff, SIMDATA_SIZE);
memcpy(&sd, &buff, SIMDATA_SIZE);
rpm = sd.rpms;
rpm = sd.rpm;
maxrpm = sd.maxrpm;
}