Friday 18 February 2011

Arduino + ikea box + flightgear = flykeaduino

Hello there. It's been some time since my last post. I got some new stuff and ideas meantime so it's time to share something.

Recently I have played flightgear a lot, it is a very good open source flightsim and it has some usefull abilities. One of the most usefull things is that flightgear provides access to simulation parameters via telnet ! Using it for making own control system was really easy.

First I've wrote a simple app for arduino to utilize six switches and one potentiometer. Arduino sends the data about switches state using serial. You can download the code here.


Next I've used a box from ikea some wires and soldering iron to make a simple control panel. The switches are connected in the most basic way. Every switch has +5V, ground and one digital input pin connected. The potentiometer is connected in the same way except that it uses  the analog input pin.



The data from arduino is parsed by python script which connects to flightgear by telnet and sets proper values for various controls. You can find the script here.

Usage:
- connect arduino, compile and flash the app
- run flightgear with  "--telnet=5401" argument
- run the python script
- done ! use switches and buttons to control flightgear

Have fun :)

2 comments:

Anonymous said...

Just a small tip, when using many variables in the Arduino script, the use of an ARRAY comes in very handy when all is said and done. especialy as arrays are numbered from 0 + so the number of array can correspond to what pin it is essential for.

Anonymous said...

It would have nice if Anonymous could have edited the python script and added his ARRAY feature and paste the changes in the comment section for others to share or email to author.