Arduino 2-Digit 7-Segment Display with Buttons: Sketch

Posted June 29th, 2010 by Natalia and filed in Arduino, Project

As you could see from last week’s full Arduino sketch listing, the source code for the 2-digit 7-segment display project using buttons is strikingly similar to the one without the buttons; praise for ‘copy and paste‘! (It is worth noting, though, that ‘copy and paste‘ can be responsible for a higher percentage of bugs than I’d care to admit).

There are just a couple of snippets that I would like to comment on:

The first part of the loop() function checks whether either button has been pressed and increments the value of each digit.
Continue Reading »

Arduino 2-Digit 7-Segment Display with Buttons

Posted June 22nd, 2010 by Natalia and filed in Arduino, Project

This week we modify the original circuit and sketch to include two buttons, one to control each digit of the display.

Here’s what the setup looks like:

2-Digit 7-Segment Display

And here’s the complete sketch:
Continue Reading »

Controlling a Seven-Segment Display Using Arduino Part 3

Posted February 15th, 2010 by Natalia and filed in Arduino, Project

The second sketch cycles through the numbers from 0 to 9, but only increments the display counter each time a button is pressed. Note that this code includes simple debouncing by introducing a short delay when the Arduino detects that the button has been pressed.

Continue Reading »