Hello,
I am working on one of my first Arduino projects, which is to make a 4 digit 7-segment LED function as a clock. I've been enjoying working through the challenges, but I have run into bit of a problem. In the program, I have created functions that can be called to display a particular number value from 0-9:
//make a digit read "2" (turn specific segments of the display on or off)
int number2() {
digitalWrite(1, HIGH);
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
}
The trouble I am having is in calling the function. I have put together a loop that counts millisecond, second, minutes and hours, and I would like to change the function "number__()" to respond accordingly. i.e., if minute = 3, I would like to call the number3() function for the minute representation.
My main question is this, is there a way to make the digit inside the function "number__()" a variable so that it changes from number1() to number2() to number3() when it is appropriate? I've tried searching around for a solution, but to be honest, I wasn't really sure what keywords to use to describe this issue. Thanks guys, I really do value your time and help.