Hardware encoders for G1000 controls?

Hey all, not sure where to post this, so I’m jamming it in here and I’ll trust a helpful moderator to school me if I mess up.

I have some rotary encoders on an arduino device, and what I really REALLY want to be able to do is use those encoders to act as knobs for control of map zoom on the G1000, and other aircraft with maps.

I do not need to be told about ‘knobster’ hehe, I already have a device, I’m just trying to learn how to map it that way. I can’t find any obvious control in the sim to control these kinds of features.

Thanks to ANYONE who has suggestions.

Hi there!
I moved your topic into #self-service:home-cockpit-builders

1 Like

You’re a rockstar, Hester, thank you.

1 Like

This app might work for you. I use a custom switch/encoder box based on an Arduino Leonardo with it. You’ll have to fiddle around with the JoystickMappings.xml file to make it suit your particular button mappings but, you should be able to mostly cut-n-paste from the supplied Bravo profile.

I’ll have a look, thanks for the suggestion!

Puoi provare la scheda 2095 di Desktop Aviator. Io la uso da tempo ed è perfetta. Non ha bisogno di Arduino ed è USB.
http://www.desktopaviator.com/Instructions/Model_2095A/

Grazie. Ho già costruito la scatola con Arduino, anche se questo prodotto potrebbe essere interessante per build in futuro.

Il problema che ho è che il simulatore di volo non mi consente di mappare direttamente i controlli G1000. Penso che la risposta precedente farà ciò di cui ho bisogno. Ma ancora grazie per questo collegamento.

Check out MobiFlight does a nice job with rotary encoders. I use one to control the MFD range.

1 Like

Thanks, I’ll check that out.

–EDIT–OMG, I’m THAT user I just noticed the PDF that explains this… reading it, don’t shoot me yet

So I’m trying to use your app, but I’m not sure I’m doing anything right to get it working.

I believe I’m not understanding your mapping xml, I’m a bit out of my wheelhouse with this stuff, so hopefully you can set me right.

The arduino is identified in windows, and Flight sim can see it and is happy talking to it. Happily it is identified exactly the same as the one in your settings as 'Arduino Leonardo"

To do a test, I first found which input one of the encoders was using. Turns out its was 4 if incrimenting, and 5 to decrement with 6 being the PUSH function… So as a test I did this in the mappings.xml

<Joystick MappingName="Arduino Leonardo - Default" Name="Arduino Leonardo">
		<JoyMap JoyEvent="Button4" JoyEnableEvents="Button16,Button34,Button36,Button18" SimEvent="MobiFlight_AS1000_MFD_RANGE_INC" /><!--CRS INCR-->
		<JoyMap JoyEvent="Button5" JoyEnableEvents="Button16,Button34,Button36,Button18" SimEvent="MobiFlight_AS1000_MFD_RANGE_DEC" /><!--CRS DECR-->
</Joystick>

I’m unsure what the "JoyEnable Events’ is actually doing so I didn’t mess with that (probably part of my problem)

Anyhow, reran the app, and no result for manipulating the knob.

So, I know I’m the idiot here, so be gentle, but if you can clue me in what I’ve got wrong, I’d really appreciate it.

Get rid of the JoyEnableEvents and you should be good to go. They are there to allow one event to be used in several different modes.

So…

     <Joystick MappingName="Arduino Leonardo - Default" Name="Arduino Leonardo">
      	<JoyMap JoyEvent="Button4" SimEvent="SIM_EVENT_1" />
     </Joystick>

would unconditionally send SIM_EVENT_1 every time Button4 was clicked.

<Joystick MappingName="Arduino Leonardo - Default" Name="Arduino Leonardo">
 	<JoyMap JoyEvent="Button4" JoyEnableEvents="Button1" SimEvent="SIM_EVENT_1" />
 	<JoyMap JoyEvent="Button4" JoyEnableEvents="Button2" SimEvent="SIM_EVENT_2" />
 	<JoyMap JoyEvent="Button4" JoyEnableEvents="Button1,Button2" SimEvent="SIM_EVENT_3" />
</Joystick>

would send SIM_EVENT_1 when Button4 was clicked but only if Button1 was held down at the same time, send SIM_EVENT_2 when Button2 was held down at the same time and send SIM_EVENT_3 when both Button1 and Button2 were held down at the same time as clicking Button 4.

So in your case you probably want this

<Joystick MappingName="Arduino Leonardo - Default" Name="Arduino Leonardo">
  	<JoyMap JoyEvent="Button4" JoyEnableEvents="" SimEvent="MobiFlight_AS1000_MFD_RANGE_INC" />
  	<JoyMap JoyEvent="Button5" JoyEnableEvents="" SimEvent="MobiFlight_AS1000_MFD_RANGE_DEC" />
  </Joystick>

Using the JoyEnableEvents is a bit complicated but will allow you to use a single encoder to control many different systems in the sim.

Thanks for the extra info!

Yeah, after I noticed the PDF I was largely on my way. Still have some config to work, and some of your mode capabilities will be very fun to work with.

Thank you for this cool little app.

Right now, Mobiflight is the only way to interface with Garmin controls via an external device, be it a Knobster or otherwise.

AP softkeys are all SimConnect events, as are radio controls, but if you want to use the Garmin FMS softkeys, the main soft keys along the bottom, the FMS and pan / zoom knob, it has to be via Mobiflight. At least until Asobo expose those SimConnect variables. They’re listed in the APK documentation, but currently they do nothing.

1 Like

Yes to Crunchmeisters point, you can do a lot with a joystick emulation, I’m using for throttle, mixture and prop feather as well as some switches. But to get the auto pilot to do anything useful you will need Mobiflight. Happy flying!

1 Like

Well, E1lephant’s app is referring to the mobi plug in, but I like it better because it seems to be lighter weight (as far as the app front end) and doesn’t require loading a custom sketch to my device.

Since this app required components from Mobiflight, I stopped during the process and messed with Mobiflight a bit. I suppose if I had a more complex rig, that app would make more sense. But it sure looks to me like for simpler devices, this one might be better.

Either way I have it up and doing what I want, so problem solved. The tinkering continues, still haven’t figured out what control might map the range zoom in the CJ4… I have the garmins working with that tho. And for some reason the JF Piper Arrow III com radios don’t seem to be responsive to any of the com radio inputs, even tho I have that mapping working in every other plane. I’ll figure it out.

I think it is

Generic_Upr_RANGE_INC and Generic_Upr_RANGE_DEC in MobiFlight for the upper (PFD) range knob. They are available in dropdown menus on MobiFlight if you use the beta releases (that’s fairly recent stuff as we’ve been writing down the events for various planes)

Mobiflight indeed works well for more complicated panels, but nothing of course stops you from mapping a single encoder :slight_smile:

1 Like

Thanks, I’ll see if I can find that.