# Thread: Flash Guages including source code

1. Thanks for the clarification. I was indeed comparing apples to oranges.

I was researching some info about lateral G forces, and it can get very very complicated fast. I think a better alternative is a very simple approach. Determine what your speed you are going now, and compare that to one second ago, and just determine the speed difference.

If 1 second ago you were doing 50 and now you are doing 55 (RR Updates everything at 1 second intervals) then you have a +5 on the flash gauge.

Now the question what would be reasonable top and bottom thresholds for these numbers? With decent acceleration, you can go 0 to 60 in 8 seconds or so, as an example. This would give you a reading of 7.5 or so on the flash gauge (If the acceleration was constant that is). Then the lower end of the spectrum for hard braking as well would be needed.

2. Most cars can't do more than 2 Gs generated from the driveline or braking, most tires can't handle more than 1.6 Gs laterally, an alcohol funny car does about 4.6 Gs in a 300MPH 1/4 mile run.

Bottom line if you're talking about accel/decel and lateral: a 2G limit ought to cover you all the way around for 95% of cars on the road today.

@MGD: Those Tornados were the only aircraft I ever saw on the Nellis Training Range that would have tree limbs stuck in their leading edges after a mission.

3. Hey john, don't you have a fusion brain? and don't they offer accelerometers?

So... couldn't you just put 3 in (if you want a z axis, 2 for just x/y) and have it pull the info from those to put into the flash gauge?

4. Originally Posted by monkeyracer
Hey john, don't you have a fusion brain? and don't they offer accelerometers?

So... couldn't you just put 3 in (if you want a z axis, 2 for just x/y) and have it pull the info from those to put into the flash gauge?
Originally Posted by JohnWPB
I want something to mimic an accelerometer or G-Force meter. When you are at a steady speed, it will be vertically centered at 0. If you increase speed, depending on how rapidly you are increasing speed, the bar will increase, and the opposite if slowing / braking.

Sure an accelerometer or G-Force meter could be interfaced to RR using a Fusion Brain or something.... But there has to be a way to approximate this with the GPS speed being monitored and some calculations based on that input.

If you are doing 50MPH, and 1 second later you are doing 60MPh then you are accelerating pretty hard for instance.

5. Originally Posted by JohnWPB
I want something to mimic an accelerometer or G-Force meter. When you are at a steady speed, it will be vertically centered at 0. If you increase speed, depending on how rapidly you are increasing speed, the bar will increase, and the opposite if slowing / braking.

Does anyone know how to calculate something like this based on rate of speed increase?

Sure an accelerometer or G-Force meter could be interfaced to RR using a Fusion Brain or something.... But there has to be a way to approximate this with the GPS speed being monitored and some calculations based on that input.

If you are doing 50MPH, and 1 second later you are doing 60MPh then you are accelerating pretty hard for instance.
well, to put it another way; you could calculate your current speed by measuring the distance you travel and the amount of time it takes to travel that distance. Or you can use the equipment that is designed to do give you that info right away. Same thing with the accelerometer, you could try to find out the right equations and have your 1hz gps signal allow the calculations at that moment.

OR... you can have an accelerometer calculate that for you automatically.

BTW 1G of acceleration is 9.80665 meters per second per second. So if you were at rest (0G) and one second later are at 9.8 meters per second (21.92 MPH or so) and the next second later you are at 19.6 meters per second, you are accelerating with a force of 1G. So, at 50 MPH plus one second at 1G, you would be going 72 MPH. It is a constant formula, so it wouldn't actually be that hard to do (I was just giving you flak when you have a fusion brain and the accelerometers are fairly cheap.)

What would be cool would be a x/y graph that has a pic of a car as the pointer, when accelerating forward, the pointer would go to the lower part of the screen and turning left the pointer would go the right part of the screen.

I guess you were thinking of the minions that have your DFX skin and want that info without having to buy the FB and accelerometers.

6. so thinking about it more, you would have to find a way to find out the change in speed since the last known update (probably with an autoit script) and then apply the calculations each second, and then display the result in a variable that flash would read and display.

This won't allow left and right G's though, so it would only be forward G's, which I'm not sure what the point of knowing that info would be. I'd assume it would be more important for left/right and if you are autocrossing.

7. Originally Posted by monkeyracer
well, to put it another way; you could calculate your current speed by measuring the distance you travel and the amount of time it takes to travel that distance. Or you can use the equipment that is designed to do give you that info right away.

What would be cool would be a x/y graph that has a pic of a car as the pointer, when accelerating forward, the pointer would go to the lower part of the screen and turning left the pointer would go the right part of the screen.

I guess you were thinking of the minions that have your DFX skin and want that info without having to buy the FB and accelerometers.
That is exactly what I was wanting to do, more just eye candy than anything really Being a small plane pilot, I am used to the artificial horizon as well as banking indicators ect. I just was thinking somehting like that on the mundane gauges screen would be a nice addition.

You mention getting the speed by measuring distance traveled, and time to travel that distance.... I was just going to use the GPSSPEED in RR. Basically, grab the speed, store it, one second later compare to the last speed. This will give rate of acceleration / deceleration in a one second time frame.

As for banking / turning, the same thing could be done with the GPDHEADING as well. Grab the heading, store it, compare one second later to see just how quickly you are turning ect.

I can do all the math and such with an AI script, I just do not know how to do flash Preferably the code should all be action script inside the swf to do the calculations, I just do not know flash in the slightest.....

8. gimme a visual example of how u'd like it to look and i'll whip something up for ya.

9. GPSSPD and GPSHDG will work for those guages, but you would need an autoit script to store the speed and heading one second ago to compare to now and display a new variable, which you can put into flash as dynamic text with that variable.

here's some inspiration pics:

(the left right and brake/gas part)

(bottom left corner)

Maybe like this, but flipped so that left is on the right side, and accel is on the bottom. That way when you turn left, the pointer moves to the right (like all the stuff in your trunk) and if you brake hard the pointer goes to the top (again, like the stuff in your trunk...) if you are accelerating AND turning, the pointer will not be on the line.

10. Thanks sonic, I will try to put something together here and see what you think.

@Monkey, yea, that graphic is kinda the idea I had in mind actually! Now quit posting, and go clean out your trunk! :P

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•