Hello I would like to make a flight simulator with switches that would emulate a keyboard with Arduino Leonardo eg Ctrl + S, Ctrl + Alt + C etc. and also have the possibility to have more than 13 switches with one Leonardo. Can someone help me with the code. Clasyl57@gmail.com
ClaudeL:
Can someone help me with the code.
No because you didn't post any.
But, you could start here: Arduino Playground - HomePage
You can hook up keyboards to be used as input.
Two other ways you can get more buttons:
- Use a button matrix, for instance 16 buttons can be run from 8 IO pins (4x4).
- Use an external IO expansion device, such as an MCP23017 / MCP23S17 or a P-S Shift Register.
Sorry i'm brand new with programming, can you give me a exemple ex: how to program Ctrl+E
No, I cannot. You are starting from completely the wrong end of the project.
First you should design how you are going to connect your buttons. Then, and only then, can you start to think about writing the code to read those buttons and convert them into key codes.
Well, and for that matter... why run a flight simulator on an Arduino? It is too limited to do a very accurate simulation, and what would be the output of that anyway? Usually we do the other way around, we run a simulator on the computer, and we can do HIL-simulation, and have our Arduino fly the simulated aircraft. Arduino is designed to run hardware in the physical world, such as an aircraft, not to simulate said aircraft in a virtual world.
Google Code Archive - Long-term storage for Google Code Project Hosting. (explains how we can hook up an Arduino-based auto-pilot unit, and have it fly a simulated airplane running on the computer)
Doing it the other way around doesn't make sense? Unless... are you talking about having the Arduino run the motion units of a full-motion simulator?
Part of being a good programmer/engineer is using the right tools for the job. So, please explain yourself - why run a flight simulator on Arduino?
My understanding (heavily interpreted by my vast brain power - I run a PIC32 ) is that he is building a flight deck to control a PC based flight sim - hence the need to emulate certain key presses, like (I would guess) CTRL-F to extend flaps, etc.
Thank you all, you made me progress, now I managed to connect and program 14 switches which work very well in Flight Simulator. Now I would like to know how to connect and program more than 14 other switches. Thank you for your help !!!
We have given you suggestions - your job now is to decide on the best way for you. We can't do that for you.