From 218baed2edc0fc65a39f3321ec9d1415fb21d3b2 Mon Sep 17 00:00:00 2001 From: Paul Dino Jones Date: Sat, 17 Feb 2024 18:50:57 +0000 Subject: [PATCH] Add more user variables in arduino code --- src/arduino/shiftlights/shiftlights.ino | 16 +++++++++++++--- src/arduino/simwind/simwind.ino | 6 +++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/arduino/shiftlights/shiftlights.ino b/src/arduino/shiftlights/shiftlights.ino index 6d25b76..4ae4946 100644 --- a/src/arduino/shiftlights/shiftlights.ino +++ b/src/arduino/shiftlights/shiftlights.ino @@ -7,6 +7,16 @@ #define NUM_LEDS 6 #define BRIGHTNESS 40 +#define COLOR1A 0 +#define COLOR1B 0 +#define COLOR1C 255 +#define COLOR2A 0 +#define COLOR2B 255 +#define COLOR2C 0 +#define COLOR3A 255 +#define COLOR3B 0 +#define COLOR3C 0 + CRGB leds[NUM_LEDS]; SimData sd; int maxrpm = 0; @@ -75,15 +85,15 @@ void loop() if (l >= numlights / 2) { - leds[l] = CRGB ( 0, 0, 255); + leds[l] = CRGB ( COLOR1A, COLOR1B, COLOR1C); } if (l < numlights / 2) { - leds[l] = CRGB ( 0, 255, 0); + leds[l] = CRGB ( COLOR2A, COLOR2B, COLOR2C); } if (l == numlights - 1) { - leds[l] = CRGB ( 255, 0, 0); + leds[l] = CRGB ( COLOR3A, COLOR3B, COLOR3C); } if (lights[l] <= 0) { diff --git a/src/arduino/simwind/simwind.ino b/src/arduino/simwind/simwind.ino index e56dc71..79834df 100644 --- a/src/arduino/simwind/simwind.ino +++ b/src/arduino/simwind/simwind.ino @@ -3,7 +3,7 @@ #define BYTE_SIZE sizeof(SimData) #define KPHTOMPH .621317 - +#define FANPOWER .6 Adafruit_MotorShield AFMS = Adafruit_MotorShield(); @@ -46,6 +46,6 @@ void loop() { { v = 255; } - myMotor1->setSpeed(v); - myMotor2->setSpeed(v); + myMotor1->setSpeed(v*FANPOWER); + myMotor2->setSpeed(v*FANPOWER); }