![]() ![]() ![]() In the setup function we define each pin that connects the microcontroller and the display as output, because we want to control the display from the view of the microcontroller. We save the combination of values also in an array. Because my 7 segment display has a cathode configuration, the 1 is displayed with 0000110 and 8 with 1111111. You can use the table for the anode or cathode configuration to see which of the 7 pins has to be 0 (LOW) or 1 (HIGH). You can either comment the other lines or delete them, if you do not need them.īecause we want to display the numbers 1 and 8, we have to define how to control all digital I/O pins to get the desired numbers. Depending on your microcontroller, you only have to select one of the first three lines. Later we can access every element in the array to make our lives a little easier. Therefore I explain the Arduino script in detail.Īt the beginning of the script we create an array, called LEDs that stores all the connection pins to the 7 segment display. The script is a bit tricky if you did not use arrays before. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |