ESP8266 x 4桁7セグ TM1637 x HCS-R04


4桁7セグ TM1637表示 02 + 距離センサー


ソースコード



#include 
 
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()
{
  Serial.begin( 115200 );
  Serial.println("");
  Serial.println("start");
  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);
 }
}