SlotForum banner
1 - 13 of 13 Posts

· Registered
Joined
·
8 Posts
Discussion Starter · #1 ·
Hi from the Netherlands,

currently we, at Olympia Race Circuit Amsterdam, are busy to create new race control boxes for each driver stand. They are scratch build and I’ve now came across some challenges and I hope you guys are able to help.

these are the boxes (1 for each lane)
Automotive lighting Green Automotive tire Hood Motor vehicle


in the current situation the each ledstring is dedicated to a lane. And in each ledstring LED 0 u/l LED 9 are setup to show the fuel for that lane. So the boxes look like this now:

Electronic instrument Audio equipment Gadget Musical instrument accessory Table

Rectangle Font Parallel Pattern Audio equipment

Now I have some questions;

why is the fuel reducing from Led 0 towards Led 9, and is there a way to reverse this? So it’s going from Right (full) to left (empty).

And then the second question;
Is there a possibility to change the fuel leds colors? For a good and quick overview we would like to change all the lights into the lane colors. Would this be possible? And if so, how and where in the sketch or RC could this be done?

Rectangle Purple Violet Pink Font


if any more info is required or you have some questions, please let me know.

thanks in advance,

Ivar
 

· Registered
Joined
·
230 Posts
I may not understand your issue completely but I would have thought that the simplest solution to your problem would be to move the LEDs around so that LED 0 is where LED 9 is and vice versa.

For the second issue, I have a feeling that there is a configuration screen for colour in the Arduino setup screens but I would need to check.

If not, you can definitely solve both problems in the sketch, if you know someone clever enough to programme it. I might be able to help but there is no guarantee that I could. I'm very much a 'press buttons until it works' type of programmer.
 

· Registered
Joined
·
8 Posts
Discussion Starter · #3 ·
I may not understand your issue completely but I would have thought that the simplest solution to your problem would be to move the LEDs around so that LED 0 is where LED 9 is and vice versa.

For the second issue, I have a feeling that there is a configuration screen for colour in the Arduino setup screens but I would need to check.

If not, you can definitely solve both problems in the sketch, if you know someone clever enough to programme it. I might be able to help but there is no guarantee that I could. I'm very much a 'press buttons until it works' type of programmer.
Hi, thanks for your reply!

yes, changing over the ledstrip is an option, but also alot of work since they are all glued in. Besides that, for some reason, at our first bridge the lights went from right to left, and I don’t want to risk it to change the strip over and find out that it miraculously changed over again.

About the lane colors, if you would like to give it a try or point me in the right direction, that would be very much appreciated.

Tire Wheel Hood Automotive tire Automotive lighting
 

· Registered
Joined
·
230 Posts
Ok. A couple of things. Have a look at the Arduino configuration post that is pinned at the top of the Race Coordinator forum page. It is everything I have managed to find on RC and Arduino; and it also explains how I programmed the sketch for my requirements. It is NOT a masterclass in programming but it was how I got it to work. Dave tells me that there are several things wrong with it and he's the expert in it all, so if he pitches in with something, you know that it is correct.

Having looked at the sketch again, there is a section for configuration for fuel. This is the section:



case extFuel:
// Fuel
#ifdef WITH_FUEL_STUTTER
{
SERIAL_PRINTLN("*Got extFuel");

byte lane = inBuffer[2] TXT_TO_INT_CONVERSION;
if (lane < FUEL_NUM_LANES) {
byte level = inBuffer[3] TXT_TO_INT_CONVERSION;

SERIAL_PRINT("Got fuel for lane ");
SERIAL_PRINT(lane);
SERIAL_PRINT(" and value ");
SERIAL_PRINTLN(level);

if (level == 0 && !fuelOOF[lane]) {
// Assume power is on, setting time to 0 will cause it
// to turn off
fuelOOF[lane] = true;
fuelTimeUs[lane] = 0;
fuelPowerOn[lane] = true;
}
else if (level > 0) {
// This will turn power back on if its not already
fuelOOF[lane] = false;
}
}
}
#endif
break;

So, my reading of this is that you should be able to turn on your specific LEDs based on the value of 'level's. I'm guessing that those values range from 0 to 255, so, every time 'level' drops in value by 25(ish) another light goes off (or on). Eg if level == 255, then all 10 LEDs are lit; if level == 230, then light only 9, etc.

You should be able to figure out the way to light the correct LEDs from the code in the RaceState section, along the lines of this:


case 2:
// Initial countdown Start
{
lightOn = false;
int LED = 4 - (inBuffer[3] TXT_TO_INT_CONVERSION);
if (LED < 0)
{
for (int i = 0; i < 5; i++)
{
rgbLedStrings[0].leds = CRGB::Black;
rgbLedStrings[1].leds = CRGB::Black;
}
}
if (LED == 4)
{
rgbLedStrings[1].leds[4] = CRGB::Red;
rgbLedStrings[0].leds[4] = CRGB::Red;
}
if (LED == 3)
{
rgbLedStrings[1].leds[3] = CRGB::Red;
rgbLedStrings[0].leds[3] = CRGB::Red;
}
if (LED == 2)
{
rgbLedStrings[1].leds[2] = CRGB::Red;
rgbLedStrings[0].leds[2] = CRGB::Red;
}
if (LED == 1)
{
rgbLedStrings[1].leds[1] = CRGB::Red;
rgbLedStrings[0].leds[1] = CRGB::Red;
}
if (LED == 0)
{
rgbLedStrings[1].leds[0] = CRGB::Red;
rgbLedStrings[0].leds[0] = CRGB::Red;
}
}

break;

For the colour of the lanes, that (I think!) should be a lot simpler, as these will not change and are not dependent on any information coming from Race Coordinator. It should be a case of telling the Arduino which LEDs directly to light and with which colour. Eg if lane ==1 {rgbLedStrings[1].leds[10,11,12....19] = CRGB::Blue;} says, if lane 1, then set LEDs 10 to 19 to blue.

Have a look at this first and come back to me with any specific questions you have because I know how difficult it can be trying to interpret things that other people say, when they are generalising. I can't test this myself, as I don't have an analogue setup but I can perhaps give you some code and more pointers.

Connal
 

· Premium Member
Joined
·
1,973 Posts
Just catching up... You can't change the support RC has built in for rgb leds. It's there as an out of the box solution. You either like it or you don't. You can configure what color you want a lane color to show up as because often times what's on a computer screen looks very different than what an LED looks like, but fuel does not use lane color at all so you can't change it.

You also can't change the 0-9 or 9-0 way it displays fuel. As suggested you have to orient the leds the way you want it to look...

As mentioned, you can code in the sketch whatever you like. What's displayed above is a snippet from the latest beta's sketch in which fuel stuttering was implemented. You could hook into that same code (I believe the value is 0-100 as a percentage, but I'd have to double check). Armed with that you could control your leds yourself, but the code could be a challenge for a non-programmer and I don't have the time to help, but what you're asking is 100% doable in the sketch.
 

· Registered
Joined
·
8 Posts
Discussion Starter · #6 ·
Ok. A couple of things. Have a look at the Arduino configuration post that is pinned at the top of the Race Coordinator forum page. It is everything I have managed to find on RC and Arduino; and it also explains how I programmed the sketch for my requirements. It is NOT a masterclass in programming but it was how I got it to work. Dave tells me that there are several things wrong with it and he's the expert in it all, so if he pitches in with something, you know that it is correct.

Having looked at the sketch again, there is a section for configuration for fuel. This is the section:



case extFuel:
// Fuel
#ifdef WITH_FUEL_STUTTER
{
SERIAL_PRINTLN("*Got extFuel");

byte lane = inBuffer[2] TXT_TO_INT_CONVERSION;
if (lane < FUEL_NUM_LANES) {
byte level = inBuffer[3] TXT_TO_INT_CONVERSION;

SERIAL_PRINT("Got fuel for lane ");
SERIAL_PRINT(lane);
SERIAL_PRINT(" and value ");
SERIAL_PRINTLN(level);

if (level == 0 && !fuelOOF[lane]) {
// Assume power is on, setting time to 0 will cause it
// to turn off
fuelOOF[lane] = true;
fuelTimeUs[lane] = 0;
fuelPowerOn[lane] = true;
}
else if (level > 0) {
// This will turn power back on if its not already
fuelOOF[lane] = false;
}
}
}
#endif
break;

So, my reading of this is that you should be able to turn on your specific LEDs based on the value of 'level's. I'm guessing that those values range from 0 to 255, so, every time 'level' drops in value by 25(ish) another light goes off (or on). Eg if level == 255, then all 10 LEDs are lit; if level == 230, then light only 9, etc.

You should be able to figure out the way to light the correct LEDs from the code in the RaceState section, along the lines of this:


case 2:
// Initial countdown Start
{
lightOn = false;
int LED = 4 - (inBuffer[3] TXT_TO_INT_CONVERSION);
if (LED < 0)
{
for (int i = 0; i < 5; i++)
{
rgbLedStrings[0].leds = CRGB::Black;
rgbLedStrings[1].leds = CRGB::Black;
}
}
if (LED == 4)
{
rgbLedStrings[1].leds[4] = CRGB::Red;
rgbLedStrings[0].leds[4] = CRGB::Red;
}
if (LED == 3)
{
rgbLedStrings[1].leds[3] = CRGB::Red;
rgbLedStrings[0].leds[3] = CRGB::Red;
}
if (LED == 2)
{
rgbLedStrings[1].leds[2] = CRGB::Red;
rgbLedStrings[0].leds[2] = CRGB::Red;
}
if (LED == 1)
{
rgbLedStrings[1].leds[1] = CRGB::Red;
rgbLedStrings[0].leds[1] = CRGB::Red;
}
if (LED == 0)
{
rgbLedStrings[1].leds[0] = CRGB::Red;
rgbLedStrings[0].leds[0] = CRGB::Red;
}
}

break;

For the colour of the lanes, that (I think!) should be a lot simpler, as these will not change and are not dependent on any information coming from Race Coordinator. It should be a case of telling the Arduino which LEDs directly to light and with which colour. Eg if lane ==1 {rgbLedStrings[1].leds[10,11,12....19] = CRGB::Blue;} says, if lane 1, then set LEDs 10 to 19 to blue.

Have a look at this first and come back to me with any specific questions you have because I know how difficult it can be trying to interpret things that other people say, when they are generalising. I can't test this myself, as I don't have an analogue setup but I can perhaps give you some code and more pointers.

Connal
I can’t wait to try this out, unfortunately this wont be before thursday, but I will definitely let you know. Thanks for you advice,I hope (and think) it will work.
 

· Registered
Joined
·
8 Posts
Discussion Starter · #7 · (Edited)
Just catching up... You can't change the support RC has built in for rgb leds. It's there as an out of the box solution. You either like it or you don't. You can configure what color you want a lane color to show up as because often times what's on a computer screen looks very different than what an LED looks like, but fuel does not use lane color at all so you can't change it.

You also can't change the 0-9 or 9-0 way it displays fuel. As suggested you have to orient the leds the way you want it to look...

As mentioned, you can code in the sketch whatever you like. What's displayed above is a snippet from the latest beta's sketch in which fuel stuttering was implemented. You could hook into that same code (I believe the value is 0-100 as a percentage, but I'd have to double check). Armed with that you could control your leds yourself, but the code could be a challenge for a non-programmer and I don't have the time to help, but what you're asking is 100% doable in the sketch.
thanks for the heads up. Hopefully we will get it to work eventually, but if not it’s still an amazing program! Thanks for creating it👍🏻
 

· Registered
Joined
·
230 Posts
You're welcome.

Rereading your post, I think the second part of my reply is probably not required. If I understand correctly, you want the colour of the fuel LEDs to be the colour of the lane. If that's so, then you will need to combine the lane and the level variables, to colour the LED of the lane. eg, if lane = 1 and value = 100, then light all the lane 1 LEDs red (assuming Dave is correct that the fuel range is 0-100 and not 0-255, as I said); if lane = 2 and value = 90, then light 9 of the 10 LEDs white.

If I get a chance I'll have a play, as well
 

· Registered
Joined
·
8 Posts
Discussion Starter · #9 ·
You're welcome.

Rereading your post, I think the second part of my reply is probably not required. If I understand correctly, you want the colour of the fuel LEDs to be the colour of the lane. If that's so, then you will need to combine the lane and the level variables, to colour the LED of the lane. eg, if lane = 1 and value = 100, then light all the lane 1 LEDs red (assuming Dave is correct that the fuel range is 0-100 and not 0-255, as I said); if lane = 2 and value = 90, then light 9 of the 10 LEDs white.

If I get a chance I'll have a play, as well
Yes thats correct, thats what we want to do.
 

· Registered
Joined
·
8 Posts
Discussion Starter · #10 ·
You're welcome.

Rereading your post, I think the second part of my reply is probably not required. If I understand correctly, you want the colour of the fuel LEDs to be the colour of the lane. If that's so, then you will need to combine the lane and the level variables, to colour the LED of the lane. eg, if lane = 1 and value = 100, then light all the lane 1 LEDs red (assuming Dave is correct that the fuel range is 0-100 and not 0-255, as I said); if lane = 2 and value = 90, then light 9 of the 10 LEDs white.

If I get a chance I'll have a play, as well
I’ve been thinking, and the right to left part is not important at all if we can get the fuel leds for each lane in the right color. Because Race Coordinator (person) verified that it is in all cases from left to right that the leds turn off.

It means our first bridge’s led strip was put in upside down by accident.

What would be your approach to only change the ledcolor (and not the sequence) of the fuel leds?

thanks again for all the input👍🏻
 

· Registered
Joined
·
230 Posts
It would be the same. Once you go away from the built-in config of RC, then you have to use code: and to change the colour of the LEDs, you need to identify which lane and which LED you want to update. So, as far as the programming is concerned, it makes no difference if the order is 0 to 9 or 9 to 0.
 

· Registered
Joined
·
8 Posts
Discussion Starter · #12 ·
It would be the same. Once you go away from the built-in config of RC, then you have to use code: and to change the colour of the LEDs, you need to identify which lane and which LED you want to update. So, as far as the programming is concerned, it makes no difference if the order is 0 to 9 or 9 to 0.
Unfortunately I haven’t been able to get it to work. Have you by any chance had a go at it?

(fingers crossed)
 
1 - 13 of 13 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top