I have a 7 segment clock with 4 digits, and 2 push buttons to control time (hours seconds days month etc). What is the best way to manage the settings of each sub menu when the user wants to change the time? Is coding it myself or using a menu library such as this one better for the task? https://playground.arduino.cc/Code/Menu


1 Answer 1


I would make it myself.

One way to do it:

  • Create an enum with all states, like Normal, ChangeMonth, ChangeDay, ChangeHour, ChangeMinute };
  • Use one button to increase the item you are changing with 1
  • Use the other button go to go the next enum

You can make it fancier by using longer/shorter presses (e.g. to increase faster)

Don't forget to debounce button inputs.

  • Good idea, I like it. What is your recommendation on recognizing pushbutton presses for getting into the menu when in a for loop in another function? Commented Aug 17, 2017 at 0:42
  • You have to be very carefully with long running for loops ... It's better to not use a for loop but keep an index and keep checking in the main loop, increasing the index when you did one iteration of the loop. Or keep the for loops very short. Commented Aug 17, 2017 at 0:55
  • 1
    Great suggestions, thanks! I've eliminated all for-loops with incrementing counters and push buttons are recognized immediately! Commented Aug 17, 2017 at 19:40
  • @MarianoElia Good to hear and good luck with your project Commented Aug 17, 2017 at 22:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.