Close

Code Update: Reliable Buttons

A project log for Open Digital Checklist

Digital, portable, open source, and simple checklist for every day carry. Replace apps and paper for good.

dustinDustin 09/07/2024 at 01:030 Comments

I spent most of my day working on getting reliable button presses. Normally I'd just slap the denounce Arduino code in and move on, but it doesn't work with analog readings. I spent some time getting it to work with the realtor array that feeds into analog pin 0. That was absolutely necessary because I couldn't use buttons to toggle variable states as they were completely unpredictable. Even the "right" button, which ties to ground, was not always a consistent resistance value. I ended up checking for a range of values for each button, and then adding a denounce routine to thise readings. I finally have reliable button press detection. Next up is long press button detection, which I'll use to enter menus for adding and editing menu items. After that I still need a way to toggle checklist items and mark them as done or not done. I almost had that working, but the unreliable button presses screwed that up. That took way too long to figure out. I finally used the serial plotter to show the jitter in the analog reading and prove my theory. I should have started there...

I still have to set up routines to navigate between lists and the items they contain, then apply the check mark toggle to those. After that I need to refine the LCD refresh routines as refreshing the display too quickly causes the display to be very dim. I had some luck clearing and updating the idle screen on every 50th cycle that the routine was called. The buttons were still very responsive and the display looks great.

I sorted out backlight control the other day, and can add that in when I sort out the sleep routines. That should be easy enough. I eventually want to add a real time clock and use that for display the time as a screensaver, and setting up alarms, timers, and event reminders. Cramming all the info and settings into such a small display is challenging at times, but doable.

I want this device to have all of the basic time and task management features I need, while remaining simple and reliable. The end goal is to use something like a custom ESP32 board to add all of the hardware features I could need, such as hosting a webserver management page and sending alerts over Bluetooth.

For now, I'll be happy to get a usable device that I can carry and use every day. Good progress has been made, despite my lack of programming skills and experience. Baby steps.

For those who insist on comne ting on this project to tell me to just use a smartphone or learn to program them instead: you've missed the point and I have no patience for that. Keep your ignorant comments to yourself.

Discussions