Smart Sim Tech > Support

Reading switch inputs and assigning functions

(1/6) > >>

iwik:
Hi Tyler,
Module arrived today, 5 days delivery to New Zealand is great.
Module looks well constructed, nice compact wee unit. Soldering quality is very good.
What is easiest way to configure the inputs to activate something in Fsim. I played with the software commands and had successfully activated stuff in Fsim.
i suppose ones needs to get out Visual basic to do some serious stuff. Really just experimenting at the moment.
Keep up the good work, product looks good.
Regards
Les.
P.S The led nearly blinded me, sure lets you know things are alive.

Tyler Reed:
hey, thanks for the input on the card.

I just got to work, so I will give some thoughts on writing up something for getting started and get something posted.

Thanks,
Tyler

iwik:
Thanks,
No hurry, know what its like getting things of the ground.
les

Tyler Reed:
ok, just to try to get you going...

You will want to use the wizard on the start page to add a new card with the type of R1 and serial number of 1 if you have not done so already.

If you plug the card into your usb, you should notice the icon for the card's tab will have a green flag on it, and the log should say something about the card being connected.  The beta software has a bug where sometimes it thinks it is another card and ignores it, so if the little flag is still red, try another usb port or shutdown and restart the software.  I will have that bug fixed in the next release of the software.

On the input tab you should see inputs 1 - 30, if you want to name them so you know where they are going, you can right click on the name and hit edit.

On the input scripts tab there is a drop down of all 30 of the inputs.  Each input has 2 states, Up and Down.  For most scripts you will probably want to stick with down.  Down gets fired once the button is pushed, or the toggle switch is activated, and Up get fired once the button is released or the toggle switch is switched off.

For an example, lets call our Input #1 "Parking Brakes", now under Input scripts we will see "Input 1 Button Down (Parking Brakes)" and "Input 1 Button Up (Parking Brakes)".  Lets select Button Down.  So when the button is pushed, or the toggle switch is on, i will want to have the parking brakes on, and when the button is up or toggle is off i want the parking brakes off.  So according to page 15 of the offsets manual, 0BC8 is the offset for parking brakes, with a value of 0 for off and 32767 for on.

Sample Code for Parking Brakes, Button Down
Host.SendValue("0BC8", 32767)

Sample Code for Parking Brakes, Button Up
Host.SendValue("0BC8", 0)

So this switch will need to be "on" when the software starts, but that can be reversed just as easily so if the button is pushed the brakes are off, and so on.  Now to test this with an actual switch, take a toggle or push button switch and wire one of the wires to the "Gnd" screw on the board and the other to input #1 on the board.  With flight sim running and FSUIPC open and everything working as it should, that button will now work the parking brakes.

Also, if you leave the software on the Input Configuration mode, the red dot will go green when an input is activated.  good for debugging stuff.  I should also mention that the blue flag icon called "Debug Mode" will make it so the card will not run any of the scripts that send commands to fsuipc, so if you are labeling your inputs, debug mode will prevent your plane from acting weird as you are pushing a bunch of buttons.

Hopefully this will help you get going.  With the example above, just swap out the offset address and value for any of the other offsets.  I will also hopefully add more to the manual tonight and im looking to do some videos with some screen capture software.

Thanks,
Tyler

iwik:
Thanks Tyler,
I was missing how you tied the inputs to a function. I missed the point that each input has
a little script added.
I like the that idea. Off to work now, will give it a go tonight.
Les

Navigation

[0] Message Index

[#] Next page

Go to full version