Results 1 to 8 of 8
-
11-01-2015, 07:05 PM #1
- Join Date
- Oct 2015
- Location
- United Kingdom
- Posts
- 17
5 position start key link2fs/arduino question.
Dear all
I've just received a 5 position key switch from tinterweb. I've popped a multimeter on the contacts and worked out which pin is connected to each rotation point of the key. My question is, setting this up for a Cessna fsx, via arduino. Would you recommend a digital input or analog output?
I'm very new to coding and electronics, perhaps choosing to run before I can crawl? My plan then is to map the input types to the relevent codes in Jim's amazing link2fs, (off/L/R/Both/Start). or just off and start if only available. Key is for a tractor I believe, (it's rather big but £8 rather than £130 I've seen them for), I'm possibly assuming incorrectly that this will work via 5v? Multimeter shows 5 seperate outputs so I'm thinking 5 switches (in my head).
Will this work for my intentions with link2fs?
Many thanks
Damo.
-
11-02-2015, 12:09 AM #2
- Join Date
- Aug 2015
- Location
- Montreal
- Posts
- 84
Re: 5 position start key link2fs/arduino question.
The key switches are either on, or off. They don't have a variable output other than on or off. That is digital.
You will need to some debouncing on the inputs, one input per key position.
-
11-02-2015, 03:24 AM #3
- Join Date
- Oct 2015
- Location
- United Kingdom
- Posts
- 17
Re: 5 position start key link2fs/arduino question.
Many thanks SimSupervisor, that's a good thing for me to remember and of course it makes sense now. On/Off, High/Low = digital.
Lastly then (hopefully), l cannot find a data sheet for this, but assume it must need grounding. I can't seem to see a pin for this, but a little reading and I find 1 mention, that ground is the body of the lock. So should I just solder a ground to the metal casing? It's the Durite Ignition Switch 5 position, photo as follows.
Sorry if these questions seems silly, I'm still very much learning the ABCs.
Thanks for another lesson!
Damo
-
11-02-2015, 11:32 AM #4
- Join Date
- Aug 2015
- Location
- Montreal
- Posts
- 84
Re: 5 position start key link2fs/arduino question.
Do you have a voltmeter? Test the pins for continuity using the chassis for a gnd. Body for a ground is not the preferred approach but isn't unusual either. If it work just make sure to have something that is physically in contact with the body for the common pin and you're all set. One way to do that is with the fastener, having something bolted together with the switch, that can accommodate the wire. Soldering on the body can work but is prone to breaking.
-
11-02-2015, 07:29 PM #5
Re: 5 position start key link2fs/arduino question.
That is some switch. Please keep us posted.
---CYXD ----- TWR --- GND ------ Closed
ILS-- NDB -- 119.1 -- 121.9 ---- 11/2013
-
11-02-2015, 08:39 PM #6
- Join Date
- Feb 2007
- Location
- Argentina
- Posts
- 187
Re: 5 position start key link2fs/arduino question.
Hi everyone:
I do not agree with the solution using digital inputs.
Why? Because you'll need to use 5 digital inputs.
Why not use this connection? Only one analog input.
You need programing the Arduino to react according the range values of the analog input.
Actual positions should be given as ranges, not a single value, to exclude false reacting - i.e. the 1st position when value is in range 0-200, the second position - value 300-700, the third position - value 800-1023
This way, is not mine, is from
http://svglobe.com/arduino/a_switch.html,
All credits to Vlad Sychev.
and there you can find others good examples, and adapt the Arduino script for FSX.
(The original web, is for X-Plane)
Regards
Horacio.
-
Post Thanks / Like - 1 Thanks, 0 Likes, 0 DislikesBushPilotWannabe thanked for this post
-
11-03-2015, 12:12 AM #7
- Join Date
- Aug 2015
- Location
- Montreal
- Posts
- 84
Re: 5 position start key link2fs/arduino question.
That's an option, but I prefer keeping analogs for reading analogs... Arduinos have more digital than analogs, particularly the megas, and the digitals can be multiplexed.
-
11-03-2015, 12:00 PM #8
- Join Date
- Oct 2015
- Location
- United Kingdom
- Posts
- 17
Re: 5 position start key link2fs/arduino question.
Hi SimSupervisor, yes to the voltometer, (I assume it's the same as a multimeter). I' used it to check which pin is in the circuit with the key turns using the sound function on it, which was good, as the 'switches' don't run in number order bizarrely.
I'll rig something up to the breadboard later with the ground on the casing, via batteries I think, or the wife's computer...
Hyamesto, thanks for the input. This idea is similar to the lcd shield that I have, where the 6 buttons all output to A0 and are separated by differing resistance inputs. It is quite a good idea, but the coding gets a little complicated (for me) when trying to ascertain things between, less than up to and including a specific number, unlike just saying pin 23 does this, 24 does that etc. Good chip in however, thank you.
13yo GIRLS FILE DOWNLOADS KIDS PACK DOWNLOAD WEBSITE: OPEN IN AN ANONYMOUS BROWSER (the link does...
5.Sharing an Essay about PIC16F877