
The topic of seven-segment display character representations revolves around the various shapes of numerical digits, letters, and punctuation devisable on seven-segment displays. I have it working well now and able to manipulate it as I want, so thanks for all the help.The individual segments of a seven-segment display. Thanks for the tips, I still have a lot to learn! I don't think that was your intention anyway. Those pins are for sketch upload and communicating with serial monitor. This will set pins 0 and 1 to be outputs. Thank you, I really didn't have a proper understanding of how they work and was trying to use one like the for loop example I was fiddling with earlier. So as you read "strange" data you may expect "strange" behaviour. Example: for(int Pin=0 Pin<=8 Pin++)Īrray LED1 has 2 elements (0 and 1). You do read data that is not within your array(s) bounds. So you need to use an array of arrays, otherwise called a "2-dimensional" array. In your code, the variables who's names end "1", "2", "3" are themselves arrays. When you find yourself making many variables with "1", "2", "3" etc at the end of the variable's names, that is a sign that you should be using an array. And your code is still going to be very long. But you have not yet understood how to use arrays. Using arrays and for loops is the right way to go because, as you say, your code will get very long without them.

And, as already pointed out, LED1 has only 2 indexes. "LED1" is the array and "Pin" is the index into the array.


This code will light up the 7 segment LED from A to G 1 by 1Ĭonst int timer=5000 //Sets the delay time One thing I've noticed is that the digits it does give appear to be a combination of the previous and current number of the sequence.

If I limit the code to only display one of the numbers individually, it displays it correctly, however if I try a sequence it gives me jumbled rubbish. My issue is that it's not counting correctly. I can do it fine without using arrays or for statements but it's incredibly long and inefficient code so I found the array and for commands and figured they can do the job. Just got one of these and learning programming and trying to use a 7-segment LED to count from 1 to 8.
