Buttons array

Support for Arduino in combination with Air Manager and Air Player

Moderators: Ralph, russ

Message
Author
Rizzardjo
Posts: 10
Joined: Thu May 28, 2020 8:34 am

Buttons array

#1 Post by Rizzardjo » Thu Dec 10, 2020 12:52 pm

Hi everyone, i'm trying to build a buttons matrix with 6 rows and 7 columns. My rows are represented by pins D2, D3, D4, D5, D6 and D7. Columns, instead, D8, D9, D10, D11, D12, D13 and A0.

This is my simple code:

Code: Select all

function buttonPressedCallback(row,column)
    print("Pressed at " .. row .. ", " .. column)
end

hw_button_array_add("My keypad", 6,7, buttonPressedCallback)
I mapped all rows and columns with its correct pin. When i connect Arduino and start the program, if i connect pin D2 to D8, console prints correctly "Pressed at 0,0". The same for 0-1, 0-2, 0-3, 0-4, 0-5, 0-6, 1-0, 1-1, 1-2, 1-3, 1-4, 1-5, 1-6, 2-0 and 2-1. But starting from row 2 and column 2 the program doesn't work anymore. There is something wrong in what i made? Thank you all!

User avatar
Sling
Posts: 4445
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Buttons array

#2 Post by Sling » Fri Dec 11, 2020 8:42 am

I've just tried here and all seems to be working fine. What version of AM are you running and have you flashed the Arduino from within that same version. My test was with 3.7.10 and an Uno flashed to channel A with this version.

Tony

Rizzardjo
Posts: 10
Joined: Thu May 28, 2020 8:34 am

Re: Buttons array

#3 Post by Rizzardjo » Fri Dec 11, 2020 10:08 am

I tried both with Air Manager 3.7.10 and with the new beta version. This looks very strange! My Arduino was connected on COM13 in Channel D. I tried also to change COM port, Arduino channel, reflashing arduino and using another arduino board, but nothing :cry:
This is a link to a more detailed topic viewtopic.php?f=35&t=3997

User avatar
Keith Baxter
Posts: 2822
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Buttons array

#4 Post by Keith Baxter » Fri Dec 11, 2020 11:01 am

Rizzardjo wrote:
Fri Dec 11, 2020 10:08 am
I tried both with Air Manager 3.7.10 and with the new beta version. This looks very strange! My Arduino was connected on COM13 in Channel D. I tried also to change COM port, Arduino channel, reflashing arduino and using another arduino board, but nothing :cry:
This is a link to a more detailed topic viewtopic.php?f=35&t=3997
Hi,

When you were doing these re-flashing. You shut down AM the restarted?

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Sling
Posts: 4445
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Buttons array

#5 Post by Sling » Fri Dec 11, 2020 1:54 pm

Yes I saw the other thread. It’s best not to split the same problem across different threads. I tested with just a jumper wire and only the press callback just as in your original example. I can only assume your Arduino is either a clone that is giving spurious results or just faulty. Did you try without the button matrix attached and just a jumper wire directly inserted between the Arduino I/O sockets.

User avatar
Ralph
Posts: 5105
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Buttons array

#6 Post by Ralph » Fri Dec 11, 2020 2:26 pm

Did you flash the Arduino with our latest firmware?

We're not aware of any issues with the button array, there are quite a few people who are using them. I can give it a try here, but it'll be next week.

Rizzardjo
Posts: 10
Joined: Thu May 28, 2020 8:34 am

Re: Buttons array

#7 Post by Rizzardjo » Fri Dec 11, 2020 4:22 pm

Sling wrote:
Fri Dec 11, 2020 1:54 pm
Yes I saw the other thread. It’s best not to split the same problem across different threads. I tested with just a jumper wire and only the press callback just as in your original example. I can only assume your Arduino is either a clone that is giving spurious results or just faulty. Did you try without the button matrix attached and just a jumper wire directly inserted between the Arduino I/O sockets.
Sorry for splitting in multiple thread, but i'm new in this forum and i don't know how remove a topic. Anyway yes, i tried with only jumper, but the problem is the same. I tried this in four different arduino boards, but nothing :roll: This is a lot strange because using default arduino ide with keypad library all works fine.

Rizzardjo
Posts: 10
Joined: Thu May 28, 2020 8:34 am

Re: Buttons array

#8 Post by Rizzardjo » Fri Dec 11, 2020 4:49 pm

Ralph wrote:
Fri Dec 11, 2020 2:26 pm
Did you flash the Arduino with our latest firmware?

We're not aware of any issues with the button array, there are quite a few people who are using them. I can give it a try here, but it'll be next week.
I flashed Arduino several times from Air Manager interface. Is there another way to get an updated firmware?

Rizzardjo
Posts: 10
Joined: Thu May 28, 2020 8:34 am

Re: Buttons array

#9 Post by Rizzardjo » Fri Dec 11, 2020 4:57 pm

I can't believe it! I flashed Arduino from beta version of Air Manager. Now I flashed using Air Manager 3.7.10, then in beta version all works :D Now i'm happy :lol:

User avatar
Keith Baxter
Posts: 2822
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Buttons array

#10 Post by Keith Baxter » Fri Dec 11, 2020 5:52 pm

Rizzardjo wrote:
Fri Dec 11, 2020 4:57 pm
I can't believe it! I flashed Arduino from beta version of Air Manager. Now I flashed using Air Manager 3.7.10, then in beta version all works :D Now i'm happy :lol:
Hi,

Glad you got it working.
It is important to flash to the correct AM version. Then shut down AM and restart. Sometimes you have to do a system reboot.

Happy for you.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests