Page 8 of 11

Re: Arduino controler

Posted: 25 Jun 2017, 02:05
by Oz Flyer
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

Re: Arduino controler

Posted: 25 Jun 2017, 02:22
by Oz Flyer
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.

Re: Arduino controler

Posted: 25 Jun 2017, 16:43
by OldAirmail
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?

Re: Arduino controler

Posted: 26 Jun 2017, 00:30
by Oz Flyer
the error was in ver1 there was a missing in line 121
was "pinMode(rotaries.pin1, INPUT);"
should be
"pinMode(rotaries.pin1, INPUT);"

Re: Arduino controler

Posted: 29 Jun 2017, 04:20
by OldAirmail
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.

Re: Arduino controler

Posted: 12 Jul 2017, 10:24
by Oz Flyer
Hi OldAirMail,
Have you had time to test the code yet? As I have had some problems with that version.

Re: Arduino controler

Posted: 13 Jul 2017, 03:43
by OldAirmail
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.

Re: Arduino controler

Posted: 13 Jul 2017, 03:51
by OldAirmail
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".

Re: Arduino controler

Posted: 16 Jul 2017, 11:57
by Oz Flyer
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.

Re: Arduino controler

Posted: 16 Jul 2017, 13:13
by Oz Flyer
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