LCD 1602 Shield with Analog Buttons

Since I have one of these shields, I thought I would put it to use. There are 5 analog buttons on A0. The shield has been modified to correct the D10 shorting error, and works fine while controlling the backlight with pwm. But due to the inefficiencies use of polling to check the buttons, I was wondering if anyone had any ideas to improve the performance other than just polling?

I like that I only need to use one pin to read 5 buttons, and understand that as the buttons age, and internal resistances change, I might regret using this method, for now, it is easy and a canned solution.

Would there be a possibility of doing a pin change interrupt while A0 is used as a digital pin, then converting it to an analog, reading, and reurning it to a digital pin? Or some such alternative?

The buttons will be used for menu navigation and selection if that helps, and the project I want to integrate this with is a remote serial over rf chicken coop controller. Any selections would be stored as part of a packet to be exchanged, so the buttons would not need to be fast, just functional.

At the moment, I am experimenting on an UNO R3, but the project will likely end up on a Mega2560 when all the code is assimilated.

Any thoughts? I am still too new to programming to see the forest, as all the trees are blocking my view!

-fab

But due to the inefficiencies use of polling to check the buttons, I was wondering if anyone had any ideas to improve the performance other than just polling?

Any thoughts? I am still too new to programming to see the forest, as all the trees are blocking my view!

If reading A0 once each loop is too slow to deal with menu navigation and selection, there is likely something blocking in your code and it is not trees.

If you post the code, the forum will kindly point out what is wrong. :wink:

This morning I was working on deciding the functions I need. The whole system is not determined yet, but it seemed the button polling would be a problem. Maybe not. There will not be a alot of blocking code, but since I don't have a system yet, I thought this might be the time to toss out the question.

So many descisions yet to be made!

Thanks, I'll come back when I have more info.

-fab