Author Options:

How to write a program to count switch presses for an arduino uno? Answered

Write a program to count switch presses (one complete closing and opening of a
switch is one count), and display the count in binary on 4 LEDs. When the
count exceeds 1510 (note that a subscript 10 means that the number is decimal,
so 1510 is 15 in decimal notation) the displayed count must roll over (all LEDs
must go out and the count should begin again at zero).



4 years ago

We used to be able to put subscripts to our numbers like 15

BUT HQ thought Readers were not smart enough to understand .

Do you want to use the add_instruction or the increment_instruction ?

Do you want to use the compare_instruction or the half_carry_flag ?

Are you using a quiet mercury switch ?

Classic homework question.....

Pretty simple thing to do. Some research on the Arduino site and forums will give you all th information you'll need to make it work.