Arduino controler

Discussion about special hardware
User avatar
Oz Flyer
Betatester
Posts: 673
Joined: 23 Sep 2015, 10:10
Location: YMMB, Melbourne, Australia
Contact:
Status: Offline

Re: Arduino controler

Post by Oz Flyer » 25 Jun 2017, 02:05

Hi OldAirMail,

That's the code is ver 1 of the same code I tried (V2).
I get an error on line 121 of the code "pinMode(rotaries.pin1, INPUT);"

request for member 'pin1' in 'rotaries', which is of non-class type 'rotariesdef [4]'

I have the latest ver of the Arduino IDE 1.8.3
David
OZ Flyer
Near YMMB
40+ year of Flight Siming.
subLOGIC/Microsoft Flight Sim/DTG, Microsoft Flight, DTG FSW.

User avatar
Oz Flyer
Betatester
Posts: 673
Joined: 23 Sep 2015, 10:10
Location: YMMB, Melbourne, Australia
Contact:
Status: Offline

Re: Arduino controler

Post by Oz Flyer » 25 Jun 2017, 02:22

Let me make that a bit clearer.

I was trying Ver 0.2 and buttons are offfset by one
The copy you posted is ver 0.1 and I get the error listed above.
David
OZ Flyer
Near YMMB
40+ year of Flight Siming.
subLOGIC/Microsoft Flight Sim/DTG, Microsoft Flight, DTG FSW.

User avatar
OldAirmail
Donator
Posts: 172
Joined: 10 Mar 2015, 22:00
Status: Offline

Re: Arduino controler

Post by OldAirmail » 25 Jun 2017, 16:43

1 - Do you get the same error in V.1?

2 - V1.1 is the best that I can find from Ben Buxton. Do you have a link for V2?
1 Saitek Switch Panel, 1 Radio Panel, 1 Multi Panel, 1 BIP, 1 FIP,
1 Saitek Rudder Pedal,
1 Saitek Throttle, 1 Saitek TPM, 1 Desktop Aviator GPS, 1 CH Yoke


Registered

Image

User avatar
Oz Flyer
Betatester
Posts: 673
Joined: 23 Sep 2015, 10:10
Location: YMMB, Melbourne, Australia
Contact:
Status: Offline

Re: Arduino controler

Post by Oz Flyer » 26 Jun 2017, 00:30

the error was in ver1 there was a missing in line 121
was "pinMode(rotaries.pin1, INPUT);"
should be
"pinMode(rotaries.pin1, INPUT);"
You do not have the required permissions to view the files attached to this post.
David
OZ Flyer
Near YMMB
40+ year of Flight Siming.
subLOGIC/Microsoft Flight Sim/DTG, Microsoft Flight, DTG FSW.

User avatar
OldAirmail
Donator
Posts: 172
Joined: 10 Mar 2015, 22:00
Status: Offline

Re: Arduino controler

Post by OldAirmail » 29 Jun 2017, 04:20

Thanks, greatly appreciated.

I should have time this weekend to try it out.



I'm working with a beta version of Air Manager V3. Essentially, it puts instruments on a monitor(s), either singularly or in groups (a panel).



My thought is to build a monitor frame with imbedded switches, encoders, buttons, etc. to control the aircraft and it's instruments. Naturally I'm inclined towards the Arduino as I have a number of them.

Even without SPAD.neXt LED display output, I should be able to do most of what I want using SPAD.neXt.

I could use a Leo Bodnar board, but that seems like overkill for the price.


For now it's just conceptions, but my old setup is about 4-5 years old and I want a change.


Thanks again.
1 Saitek Switch Panel, 1 Radio Panel, 1 Multi Panel, 1 BIP, 1 FIP,
1 Saitek Rudder Pedal,
1 Saitek Throttle, 1 Saitek TPM, 1 Desktop Aviator GPS, 1 CH Yoke


Registered

Image

User avatar
Oz Flyer
Betatester
Posts: 673
Joined: 23 Sep 2015, 10:10
Location: YMMB, Melbourne, Australia
Contact:
Status: Offline

Re: Arduino controler

Post by Oz Flyer » 12 Jul 2017, 10:24

Hi OldAirMail,
Have you had time to test the code yet? As I have had some problems with that version.
David
OZ Flyer
Near YMMB
40+ year of Flight Siming.
subLOGIC/Microsoft Flight Sim/DTG, Microsoft Flight, DTG FSW.

User avatar
OldAirmail
Donator
Posts: 172
Joined: 10 Mar 2015, 22:00
Status: Offline

Re: Arduino controler

Post by OldAirmail » 13 Jul 2017, 03:43

Sorry, David. I've been enjoying the new P3d V4, playing around with Air Manager V3, and making an interesting Arduino alarm using a Microwave Motion Sensor(doppler radar).


I've just set up a spare Pro Micro and tested the code that you sent - No problems noted.

However this may be where your problem is;
pinMode(rotaries.pin1, INPUT);

It compiled and worked for me without any errors.


If I use this I get an error when I try to comile it.
pinMode(rotaries.pin1, INPUT);

Image


If it makes any difference, I'm using Arduino IDE Ver 182.
1 Saitek Switch Panel, 1 Radio Panel, 1 Multi Panel, 1 BIP, 1 FIP,
1 Saitek Rudder Pedal,
1 Saitek Throttle, 1 Saitek TPM, 1 Desktop Aviator GPS, 1 CH Yoke


Registered

Image

User avatar
OldAirmail
Donator
Posts: 172
Joined: 10 Mar 2015, 22:00
Status: Offline

Re: Arduino controler

Post by OldAirmail » 13 Jul 2017, 03:51

Time to re-edit post is too short for people like me. :lol:

"If I use this I get an error when I try to compile it."


Also "the code that you sent" should be corrected to "the code in your attachment".
1 Saitek Switch Panel, 1 Radio Panel, 1 Multi Panel, 1 BIP, 1 FIP,
1 Saitek Rudder Pedal,
1 Saitek Throttle, 1 Saitek TPM, 1 Desktop Aviator GPS, 1 CH Yoke


Registered

Image

User avatar
Oz Flyer
Betatester
Posts: 673
Joined: 23 Sep 2015, 10:10
Location: YMMB, Melbourne, Australia
Contact:
Status: Offline

Re: Arduino controler

Post by Oz Flyer » 16 Jul 2017, 11:57

Hi OldAirMail,

If you could find some time to check something for me I would be much appreciated.

I am only getting 3 rotaries.

Using your wiring image posted on the 25 Jun (Which is the same one I had).

Encode_1 (top) inputs 1&2 show up in SPAD as Buttons 27&28.
Encode_2 inputs 2&3 show up in SPAD as Buttons 29&30.
Encode_3 inputs 4&5 show up in SPAD as Buttons 31&32.
Encode_4 inputs 6&7 do not show up at all in SPAD.


Also I found the switch to Button input error. It was the table starting at line 35.
It had 1 to 25 where as it need to be 0 to 24 as 1 = button 2 in Windows 0 = button 1

Thanks David.
David
OZ Flyer
Near YMMB
40+ year of Flight Siming.
subLOGIC/Microsoft Flight Sim/DTG, Microsoft Flight, DTG FSW.

User avatar
Oz Flyer
Betatester
Posts: 673
Joined: 23 Sep 2015, 10:10
Location: YMMB, Melbourne, Australia
Contact:
Status: Offline

Re: Arduino controler

Post by Oz Flyer » 16 Jul 2017, 13:13

Hi OldAirMail,
No need to do any thing from last post worked out the problem need to do a off set in other table and reduce the number of switch's to 24.
Forgot to change #define NUMBUTTONS to 24
To meet the max 32 buttons.

one other thing yours has 6 axis and 2 hat sw. I only have 5 Axis and 1 hat sw

David
David
OZ Flyer
Near YMMB
40+ year of Flight Siming.
subLOGIC/Microsoft Flight Sim/DTG, Microsoft Flight, DTG FSW.

Post Reply