Created
June 28, 2019 14:41
-
-
Save fxprime/93a440e9c025ea26eaa1af15b647210e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * www.ArduinoNa.com | |
| * ในตัวอย่างนี้ใช้ Library ของคุณ Avishay Orpaz ซึ่งสามารถเพิ่มได้จาก | |
| * Arduino IDE -> Tools -> Manage Libraries -> พิมพ์ว่า TM1637 | |
| * เลือก TM1637 by Avishay Orpaz | |
| **/ | |
| #include <TM1637Display.h> | |
| const int CLK = 3; //Set the CLK pin connection to the display | |
| const int DIO = 2; //Set the DIO pin connection to the display | |
| int numCounter = 0; | |
| TM1637Display display(CLK, DIO); //set up the 4-Digit Display. | |
| void setup() | |
| { | |
| display.setBrightness(0x0a); //set the diplay to maximum brightness | |
| } | |
| void loop() | |
| { | |
| for(numCounter = 0; numCounter < 1000; numCounter++) //Iterate numCounter | |
| { | |
| display.showNumberDec(numCounter); //Display the numCounter value; | |
| delay(1000); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment