Jump to content

Going to build switch panel for FSX; need programming help


Q2DM1

Recommended Posts

I want to build a switch panel for use as aircraft lights. I am starting out with the C172 lighting panel and five switches (bcn, land, taxi, nav, strobe). I plan to use an Arduino UNO for the brains of the panel. I do have a sketch ready to upload to the UNO, but I have yet to make the physical parts (it'll just be a box with some switches mounted to it).

 

How the box will work is it will scan the switches to see their current state and compare them to the last known state. If the two are the same, nothing happens and it will scan the buttons again. If they are different, it will construct a data byte, which begins with three random bits (010, programmed) and the five switch states (one bit per switch) and sends the new byte along with a newline char.

 

This much I can do on my own. Where I need help is once the data is sent to the PC via the UNO's on-board serial -> USB converter, what do I do with it? I know I can't expect FSX to see the data and know what to do with it. Basically I need a makeshift driver/interpreter that can read the data bytes and map each bit to an individual input.

 

Should I use an external interpreter, and construct and pipe new data to FSX? Is it possible to make an FSX plugin that does this for me? Which would be easier? How would you do this?

 

It looks like I should have no problem getting the UNO to behave like a keyboard. This may be the easiest solution, but it would basically require me to sync the virtual switches to the physical ones before it would work properly, which I would get tired of fastly if I remembered to do at all. I would also have to rewrite my soon-to-be-tested Ardiuno code.

 

*EDIT*

Tested, debugged, working.

<?php
while(1){
echo "Hey, wait! This is a trap! ";
} ?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...