Doorbell pulse counter with Arduino nano to direct the ringtone to an intercom handset

Nice idea.

You'll have to wait a bit after the first press to see if a second (or third) is on its way soon enough that you should ring two2 (or three3) instead of one1.

Can you now write a sketch that simply counts the number of times you have pressed a button, and prints the number each time it goes up?

Until you can do, you should work on that. It will necessarily drag you over some very basic issues, and coding techniques, involved with listening to buttons and reacting as you wish.

At least

  • button debouncing
  • state change (or "edge") detection

Both are covered all over the place, google and read a few articles on those sunjects, look also at the IDE examples code.

And trust me when I say nothing you learn on that side trip will be a waste of your time. In fact, just the opposite. You will have bnaked a key skill, which skill will be handy when you turn your attention back to the real goal.

a7