A-10C UFC Project

Status
Not open for further replies.

IceMaKeR

Member
Hello,

I started working on an UFC board for DCS A-10C Simulator.
i saw that i can use 40 buttons Dx joystick on the forum.
but i need aswell an output led for the master caution.
I know how to read datas from the sim but not how to send the value to the teensy board
the sim supports lua code to read write datas to it
I need some help to put me in the good way.
I use a teensy 2.0++

A picture of an UFC (not mine)
UFC_04.jpg

Thanks for your help.
 
I have never used Lua, so I'm afraid I can't help much with the Lua side of things.

There are lots of ways to use Teensy for communication. Probably the best supported is USB Serial. You didn't mention what operating system you're using, but my understand it DCS only runs on Windows, right? Here's one possible place to start:

http://lua-users.org/wiki/SerialCommunication

On the Teensy side, you'll use Serial.print() for sending ascii messages or Serial.write() if you want to send binary data, and Serial.available() to tell if your Lua code has send anything, and Serial.read() to receive it. This does require building a way to compose messages and parse them. The most common way is just using ascii text with newlines denoting the end of each message. That has the nice advantage that you can view whatever Teensy is sending in the Arduino Serial Monitor to make sure it's correct, then try to receive it with Lua.

The other more advanced way would be Raw HID. Select it from the Tools > USB Type menu. Raw HID lets you pass 64 byte packets in either direction. The nice thing about HID is your code can automatically detect the device, instead of having to select the right COM port. The Windows drivers for HID are much better than the Windows drivers for serial (Mac and Linux have good drivers), so even though HID can be more difficult, a lot of professional products go with HID.

Again, I can't help on the Lua side, but here's a page that turns up from a quick search. The HID path is probably not nearly as well travelled as Serial.

http://lua-users.org/lists/lua-l/2012-05/msg00201.html
 
Thanks paul

Dont worry for lua i will manage it.
have you some example scripts for hid?

PS: I'm on windows platform
 
Are you just using one teensy for input and output? I would like to make one of these but it's beyond my skill level at this point. I don't know all of this fancy coding stuff yet. : )
 
I'm trying a similar project for DCS 6 axis trim wheel style joystick... For someone with more basic and less coding experience, but very simple stevos758 try too...

Got the idea from this guy here: https://www.youtube.com/watch?v=hSsKeeY5NgM

Yours Icemaker is much cooler with LCD display with all that detail in your panels simply amazing! Not to mention custom code...

Any more videos on how you created your project from scratch? Teensy code?...


I bought a teensy, I understand how to setup the joystick an how to wire it...

I read & understand the basic code... on how to setup buttons into joystick code from this.
http://pjrc.com/teensy/td_joystick.html

I have programmed my teensy 2.0 with 6 axis and any number of buttons I want, Limited by the board of course...

But
I am using the Keyboard + Mouse + Joystick
USB type > from tools menu.

What I don't understand...
How did you remove the code from the keyboard & mouse? I only want the teensy to be seen as a joystick and nothing else. Please help?

I cannot find it:(
 
Last edited:
Anyway I now programmed the joystick. I understand how to program seperate axis & extra buttons on the joystick part, but I still cant find how to delete the section that has to do with keyboard + mouse. I'm guessing I have to compile the code myself with the teensy loader. Any help would still be appreciated thx:)
 
Last edited:
but I still cant find how to delete the section that has to do with keyboard + mouse.

For Teensy 2.0, it's in hardware/teensy/cores/usb_hid

That code is requires more advanced programming skills to edit. Basically, you need to edit the USB descriptor data, which tells your PC what type of device Teensy is implementing. It's ok to leave the actual keyboard and mouse code. Those bytes in the descriptor data are what matters.
 
Status
Not open for further replies.
Back
Top