WeMOS: D1 R1 mini 7 Segment I2C NTP

From OnnoWiki
Jump to navigation Jump to search

Sumber: http://www.esp8266learning.com/tm1637-7-segment-display-example.php

Wemos-and-TM1637 bb.webp

Library TM1637 bisa di ambil di

Code

/*
  Wemos Mini	TM1637
  GND	        GND
  3v3	        VCC
  D5	        SDA
  D6	        SCL
*/
#include <TM1637Display.h>
 
const int CLK = D6; //Set the CLK pin connection to the display
const int DIO = D5; //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);
 }
}




Referensi