Friday, 17 February 2012

"Handmade" input interface



All my tests on the USB output card ended so now it's time to start thinking to the input interface, for switches and buttons.

Taking inspiration from a good idea of Dave, I tried to transform an USB keyboard to an input interface. Essentially, disassembling the keyboard, I get the little circuit and with some connections and solders I am able to build an interface to connect switches and buttons.

Shorting any couple of pins I simulate a keypress (every combination is a different key). With a lot of patience, using an old flat cable (restored from an old IDE Hard Disk) I connect every single pin of the keyboard circuit to the breadboard. It has been a long and hard work because of pins are very small and closer each others.

Here is the achieved result:

Flat calbe soldered to the keyboard circuit:


The other edge of flat cable linked to the breadboard:


After a lot of attempts to get the right combinations, I mapped all the sim's commands through FSUIPC library. By this way, connecting switches / buttons to the breadboard I can control the sim. So, I made some tests using switches:



Mapped all the commands, now it's time to buy and connect real buttons.

Friday, 3 February 2012

The SIOC




Finally, it's my time...software developing!

Ok, I don't know SIOC but event driven programming language is my "specialty"

So, I study its syntax, take some example over the internet and that's it.

My first case study is a simple software which lights up leds according to the status of the sim, using FSUIPC interface library. So, I connect 3 card's output to the breadboard, on which I set up the leds. I keep in mind output number and write down my first "piece of code" in SIOC language.

First thing to do is identify the FSUIPC's variables (called OFFSET) which control the events; so, helped by documentation, I found, just as an example, offsets related to LANDING LIGHTS, TAXI LIGHT e STROBE LIGHT.
Now in SIOC I define private variables linked to sim's variables and write down procedures which belong to the sim's events (for example LANDING LIGHTS lights up)

Then, I define other 3 private variables, linked to card's output.

This little software put in relation OFFSET related variables (input) to variables linked to the card's output. In other words:

for any change of value of an OFFSET (event):

- if INPUT value is equal to 1 then set 1 to the related output;
- otherwise set 0;


Setting 1 to an output means to get 5V voltage on related terminal...using a well sized resistor the led get 2V voltage and lights up with the right power.

Nothing easier!!!!

Here is a short video which documents the achieved result: through SAITEK panel I control the plane's lights and leds light up according to the issued command.



Now I have to define all the sim's status and write down the related softwares