This is probably so simple to most people, but i'm really bad at programming and understanding the language, and the way i hope to do this is to start from the beginning, and i will learn as i make it more complicated.
i'm using a bus simulator type game (Omsi2) with real parts from a bus, and connecting them so that the real bus parts (dashboard, ticket printer, ibis (information display controller, basically an LCD with buttons) mimic the simulated items on the bus in the game, i.e. when a light on the bus dashboard comes on in game, the light on the real dashboard comes on, and so on.
There is an interface program (komsi) that starts up along with the bus simulator program, then a server program which takes the data from the simulator's interface and sends it to multiple arduino's, one for the dashboard lights, one for the gauges, one for ibis display, one for the ticket printer and finally one for the interior 'next stop' display. so a total of 6 arduinos can be connected at once.
The person who wrote the komsi interface program has moved onto other things, so the way the interface program handles the data is basically set in stone, i can't alter that, but i can alter the arduino sketches to make it work with my real bus hardware... i hope.
The dashboard part is fairly simple and working, a 'string?' of letters with either a 1 or a 0 after them separated by commas (CSV's?) are sent to the arduino on com1, and they set which pins to turn on or off, and hence the lights on the dash turn on and off as needed.
For the ticket printer i am using the included 'serial display' sketch from the examples folder in the arduino IDE,
this reads the data for the ticket printer and sends it direct to my LCD on com4, this is working ok for now.
But the bit i really need help with is the data for the ibis unit (destination display controller, and it tells you if your late, name of next stop etc),
I wish to use a 24 x 2 LCD for the ibis unit (the one in my real ibis has a slightly odd display, with larger characters on the last 3 lines that sit between the 2 lines, with a - or + symbol above those larger digits,
so maybe that is handled as a 3rd lcd line, or a custom LCD controller in the ibis unit... i'll figure that out at another date when i take it apart, for now i'm using a bog standard 24 x 2 LCD.
Now komsi unfortunately does not simply read what is showing on the in game ibis LCD and send it out, instead it extracts data from various triggers and sends it as a string, with more data than is actually on the ibis display in game.
So this data needs then moving to the right places to display in the real LCD i think. hopefully there's an attachment showing what the display should look like (or the real ibis LCD should, those last characters will be displayed on the end of line 2 of the 24 x 2 LCD.
A typical string will be like this:
1,76,2,0,19:31,- 6.0,E.-dorf Krkhaus,24,107,1,07601,
it's updated every 500 milliseconds.
On the 1st line of the real LCD, it needs to display the 7th item of that string.. in this case 'E.-dorf Krkhaus'
and there are 20 characters available on the lcd for that bit.
But, if there is nothing to display there, the string will be ' 0.0' so i need to blank the top line when that is the case?
Then on the 2nd line,
For the first 5 characters:
Display the 11th string .. in this case '07601'
Then always a space for character 6
The 7th and 8th character:
Display the 3rd string .. in this case '2'
BUT, if it's a single number, it needs a 0 putting in-front of it so it reads '02' in this case, but if it's say '11' then don't put a zero in front of it.
Then always a space for the 9th character,
For characters 10, 11 and 12:
Display the 9th string .. in this case '107'
Then always a space for the 13th character,
Characters 14, 15, 16, and 17 are for the 8th string, in this case '24'
This can be a 1 to 4 digit number, BUT it has blank spaces BEFORE the numbers when less than 4, not even sure if that can be done?
Allways a space for character 18.
Character 19:
Display the 10th string, in this case '1'.
Now, this gets displayed as 'A' or 'B' on the lcd, so if string 10 is '0' display A, if it's '1' display B... however, if nothing is to be displayed there, the string will show '-1'
In the real Ibis lcd there would then be a space, then then those large digits at the end (as shown in the attachment)
But for using a readily available 24 x 2 character LCD, i'd need to omit that space....
So carrying on the same bottom line of the LCD,
Character 20, 21, 22, 23 and 24:
Display the 6th string. in this case '- 6.0'
This is the early / late display,
and the numbers should be a maximum of '+99.0' the output string gets weird when you're more than 99.9 minutes late, and will display a # symbol for the 3rd digit, screwing the display up, so is there a way to stop displaying numbers past '+99.9' ?
i know i've typed so much, but only way i can explain it,
can anyone help me figure out what i need to do?
sorry if i got the terms wrong, csv and string and all that,
There are other bits of data in that CSV that i'd like to use elsewhere later, like the time thats on the 5th string, i'd like to take that and display it on a different lcd, but i wont attempt that untill i get this one working well.