Add more user variables in arduino code
This commit is contained in:
parent
c44af52ad5
commit
218baed2ed
|
|
@ -7,6 +7,16 @@
|
||||||
#define NUM_LEDS 6
|
#define NUM_LEDS 6
|
||||||
#define BRIGHTNESS 40
|
#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];
|
CRGB leds[NUM_LEDS];
|
||||||
SimData sd;
|
SimData sd;
|
||||||
int maxrpm = 0;
|
int maxrpm = 0;
|
||||||
|
|
@ -75,15 +85,15 @@ void loop()
|
||||||
|
|
||||||
if (l >= numlights / 2)
|
if (l >= numlights / 2)
|
||||||
{
|
{
|
||||||
leds[l] = CRGB ( 0, 0, 255);
|
leds[l] = CRGB ( COLOR1A, COLOR1B, COLOR1C);
|
||||||
}
|
}
|
||||||
if (l < numlights / 2)
|
if (l < numlights / 2)
|
||||||
{
|
{
|
||||||
leds[l] = CRGB ( 0, 255, 0);
|
leds[l] = CRGB ( COLOR2A, COLOR2B, COLOR2C);
|
||||||
}
|
}
|
||||||
if (l == numlights - 1)
|
if (l == numlights - 1)
|
||||||
{
|
{
|
||||||
leds[l] = CRGB ( 255, 0, 0);
|
leds[l] = CRGB ( COLOR3A, COLOR3B, COLOR3C);
|
||||||
}
|
}
|
||||||
if (lights[l] <= 0)
|
if (lights[l] <= 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#define BYTE_SIZE sizeof(SimData)
|
#define BYTE_SIZE sizeof(SimData)
|
||||||
#define KPHTOMPH .621317
|
#define KPHTOMPH .621317
|
||||||
|
#define FANPOWER .6
|
||||||
|
|
||||||
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
|
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
|
||||||
|
|
||||||
|
|
@ -46,6 +46,6 @@ void loop() {
|
||||||
{
|
{
|
||||||
v = 255;
|
v = 255;
|
||||||
}
|
}
|
||||||
myMotor1->setSpeed(v);
|
myMotor1->setSpeed(v*FANPOWER);
|
||||||
myMotor2->setSpeed(v);
|
myMotor2->setSpeed(v*FANPOWER);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue