The online racing simulator
Don't know if this will help... but this is what I've done using the Arduino.

This link below is to my Gear Indicator project using the Arduino but heavily based on Vladimir (AKA KADA) and Nick A.'s original LPT Gear Indicator Code.

Updated to be compatible with S2 Z28 and concerns about LAG all proved wrong. Very Responsive... very cool and even expandable.

So...

Out with the LPT Port and In with the Serial Port ( including any USB-SERIAL converter... as found on Arduino boards)

Project Status is here: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1293046321
Well, I'm pausing on doing the pretty pictures on the LCD for now. I'd like to start and look at pumping real data into this thing.

Here's what it looks like so far:

http://www.youtube.com/watch?v=wD3WWjNY-hQ

The input data for it is just a loop counter at the moment
Thanks Willard, that's something along the line of what I've done with python.

Cursed, that's some wicked LCD display stuff.
If you're eager to pump some data into the Arduino I've got some serial parsing code right here:

=:REMOVED OLD CODE:=


This code takes a serial string formatted like this: ÿrpm:1000<null>
and parses it into values and that a different handler can take. I'm sorry if it's not really commented all that well, it's still in heavy development. The <null> is supposed to be a null. (0x00, chr(0), bin(00000000)) In debug mode the parser also takes a tilde(~) since I haven't figured out how to communicate a null over the serial monitor. When it's done you have two values, OutGaugeLable and OutGaugeValue. Lable is anything before the colon( In this example 'rpm' and Value is anything after, in this case, '1000' there's some extra code in a different section that takes the text version of '1000' and turns it into either a float, a double or int; depending on which version of the function is called.

Also, I've got the aircores working and I am trying to implement the polarity pins into another shift register to save pin space on the arduino board.

Cheers, guys.
this is what I've got in another tab of the same sketch to take the value and apply the proper handling functions to it depending on what it is.

For example, rpm gets passed to a function that takes the string '1000' and turns it into an int; 1000.
This then gets passed to a remapping function to be mapped to an angle, let's say 45 degrees.
That value is then sent to a function that writes it out to arduino pins in a sin+/- & cos+/- way.

Another example is the Dash lights.
They are assigned to an output of a shift register and when a serial command like ÿshiftlight:1<null> get sent, it turns the 6th output of the shift register to 'HIGH' and the light hooked up to that output turns on.

if you're not clear about something please ask me to clarify.
Here's the code:

=:REMOVED OLD CODE:=
And finally the nut-and-bolt functions.
These are the ones that take the values ant mutate them into something usefull for the Arduino board to output to the hardware

Code:

=:REMOVED OLD CODE:=

I realize a some stuff is commented out, and my notes may be out of date at some parts, but It's still a work in progress and I'm trying to get 4 air core dials working simultaneously tonight.
Thanks for that lot. It's going to take me a while to wade through it all.

My plan was to have a python app on the PC receive the outgauge data from LFS and then have the arduino poll it, asking for the latest whenever it can.

I'll see what I can use from your samples.

Cheers!
Quote from boycey10802002 :Hey Sorry.
Busy couple of days & nights at work.
I got the GUI to put values on separate lines, but there are still some bugs to work out.

Don't exit or pause LFS before closing the GUI program, otherwise it'll freeze.
The reason for this is because the GUI won't refresh until it gets new data. The fix is to restart or unpause LFS, then my program starts getting data again and you can exit it properly.

There are some other data values like 'pit_limiter' that show weird, incorrect values, but that's because Scawen modified the Outgauge UDP packets after Nilo wrote the UDP Packet parser for LFS in 2008.

But I'll get around to fixing those. Once that's up it should be easy to get the program to send the data over USB (I've got some code I already wrote for something else laying around)

Cheers,
boycey

thx for your great job, but, i cant find how to set the serial configuration

my arduino is on COM11 and i dont know how to comunicate my arduino with your python program

my arduino simply reads nothing on serial

=/
Hey Killer,
I'm sorry I totally forgot to include the python side of things.
It'll be attached to this message, along with the proper Arduino Sketch.

As for configuring COM ports; I'm trying to get it to automatically detect which COM ports are available and then have the user select from a list and let it connect that way, but right now it's hard-coded into a couple of lines in the OutgaugeGUI.py file
There are two lines that need to be changed:
Line 13 has (port = "COM4") at the end, change it to whatever port your arduino is set to.
Also, line 81; same deal. Change "COM4" to whatever port your Arduino is.
You also need pySerial to be able to run the serial connections required for the Arduino.

Just message me if you guys have any questions, or run into problems.

For January I'm on a tight deadline for a C++ project at work so I won't be free to update much code here, but if you need something fixed or clarified I'll try to get back to you ASAP.
thx, but the sources .py have to be compiled on my pc. I have an importerror of "bad magic number" U_U

could u attach them, plz?

thx in advance.
Haha. Sorry, my bad.
New files attached.
As a note to people trying to use my Python script, I'm using python v2.6
Attached files
LFS_OutgaugeApp_2011_01_V0.04.rar - 11.8 KB - 492 views
thx , all works perfectly now, the serial comunication have a little lag but i think it can be resolved..


thxxx a lot.
There shouldn't be any lag with the serial device.
I added in some code that reduces the number of updating serial calls to the bare minimum so all that is there would be is the lag imposed by your lfs.cfg file.
i forgot turn off debug var.... xDDD that was the problem of my lag... =)
Hello
Hello guys , i want to ask if that arduino work with those rpms and boost dash that i will attach pictures in the end , and if yes what exactly i need to do to let them work , plz iam asking for ur help if it possible



regards
Attached images
5899.jpg
boost.jpg
I did some detective work for the Tach and it seems it really depends on how you want it set up to work with the PWM outputs, I don't have that style controller pre-programmed, but I could add/modify some code to make it work.
As for the Turbo, it looks like a standard, 4-wire air-core. Those have been worked into the Arduino sketch and all you need to make that work is a SN74HC595N or similar shift-register and a L293DNE, or similar motor driver. I had been planning to take a bunch of pictures and make some wiring diagrams but I've been completely side-tracked with work. I'll see if I can find some free time and try to write up some documentation about how different pieces of the sketch relate to actual hardware on a board.

To recap you need:
Those gauges you want
1 x Arduino
1 x SN74HC595N
1 x L293DNE
Some extra wire, header pins a breadboard and patience.

Google is a good resource to check how to wire up the shift registers, you can also drive a 7-segment display with a shift-register, too; along with all the other dash lights and miscellaneous warnings that happen in LFS.

I'll do my best to help you out and answer any more questions you, or anyone else, may have.


And I'll work on getting some pics up tomorrow.
Cheers.
Hello , 1st of all thx a lot for ur help and ur reply but i want to ask u what is the (SN74HC595N) and the (L293DNE) and what do u mean with the breadboard iam so sorry for those questions but realy i cant understand , and what if i want to make it on a bmw e36 dash board



regards
Google is a handy brain-extender.

Arduino Board
SN74HC595N -> link
L293DNE -> link
breadboard -> link

The two jumbles of numbers and letters are special types of integrated circuits (micro chips) the first turns its output on or off in a special order (a shift register) the second is a motor controller, used for air-core motors, like the ones commonly used in older car dashboards. As for your e36 dash, you'd have to check how it's set up.

The way my dash works I pulled the air-core motors out of an old car and just mounted them to some foam core in an arrangement that I kinda like and all I've used are those

I'm sure you'll have more questions.
Cheers.
#43 - SJB
Cant run it, every time I press START after enabling USB:
PREV_DATA[item]:
time:505190
data[item])
time:505290
Old data is NOT equal to new data
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python26\lib\lib-tk\Tkinter.py", line 1410, in __call__
return self.func(*args)
File "C:\Users\SJB\Desktop\LFS_OutgaugeApp_2011_01_V0.04\Outgauge_GUI.py", lin
e 113, in startDataPull
USB_Writer.writeAdvancedUSBMessage(OUTGAUGE_CONNECTION, str(data[item]))
File "C:\Users\SJB\Desktop\LFS_OutgaugeApp_2011_01_V0.04\USB_Writer.py", line
83, in writeAdvancedUSBMessage
SERIAL_CONNECTION.write(chr(255)) # Init bit
File "C:\Python26\lib\site-packages\serial\serialwin32.py", line 255, in write

raise SerialException("WriteFile failed (%s)" % ctypes.WinError())
SerialException: WriteFile failed ([Error 6] Das Handle ist ung³ltig.)

Another question:
Quote :const int SRCLK_PIN = 7;
const int RCLK_PIN = 4;
const int SER_PIN = 2;

SER = Serial data input = PIN13 at 595

But SRCLK and RCLK? Which is the "Shift register clock pin" (PIN 11 at 595) and which the "Storage register clock pin (latch)" (PIN 12 at 595)?
Edit: RCLK = "Storage register clock pin (latch)" (PIN 12 at 595) - looked at the code of a ShiftOut Example and your UtilityFunctions

But Arduino is still receiving nothing

Regards, SJB
It looks as though it's not able to connect to the correct serial device.

Have you modified lines 14 and 82 of Outgauge_GUI.py to correspond to the name or index of the COM device your Arduino shows up as? i.e. switching "COM4" to be named "COM3" or, alternatively the index 2.

And do you have pySerial installed as well?


As a side note; now that I've had more experience with C++, I'm looking at possibly changing this outugauge program over to a single .exe file so that it runs faster and is easier to install.
Did that help you at all?
#46 - SJB
No

PySerial is already installed (was a bit tricky on win7 x64: http://www.python-forum.org/py ... opic.php?f=15&t=21763 ) and Arduino is connected to COM4 (Arduino Code upload on COM4 works)-

Edit: tried the Software from PWILLARD too, but it has 1-2 seconds lag and the rpm bar (first green LED) starts at 6500 rpm O_o

Regards, SJB
When you're testing the connection to the arduino, do you have the Serial Com window connected as well as the python program? The Arduino Com Window blocks other connections to the software. If you're doing both at the same time that may be the problem.
#48 - SJB
No, I tried to open the arduino console after I opened your python script and the Arduino console said "another program blocks serial com port 4"
are you using python 2.X and a compatible version of pySerial?
#50 - SJB
python console says "python 2.6.6" and I installed pyserial 2.5

FGED GREDG RDFGDR GSFDG