Things used in this project

Hardware components:
Photon new
Particle Photon
×1
SeeedStudio Base Shield for Photon
×1
SeeedStudio 4 Digit Display
×1
SeeedStudio Grove - Universal 4 PIN Jumper
1 to connect the Display
×1

Code

TM1637 presents a clockC/C++
// tested with Photon, firmware v0.6.1

#include <TM1637Display.h>

#define CLK D4
#define DIO D5

TM1637Display displayTime(CLK,DIO);

void setup() {
    displayTime.setBrightness(0xff); //set the diplay to maximum brightness
//    displayTime.setBrightness(0x0a); //not so bright
    Time.zone(+2.00);  // setup a time zone, which is part of the ISO6801 format 
}



void loop() {
    int h = Time.hour();
    int m = Time.minute();

    // Set center colon on without array - Start
    uint8_t segto;
    int value = 1244;
    segto = 0x80 | displayTime.encodeDigit((value / 100)%10); // And off will be without this 0x80 bit set
    displayTime.setSegments(&segto, 1, 1);
    //delay(1000) ; // constant colon
    // End

    // Print Data array - Start
    uint8_t data[] = {0xff, 0xff, 0xff, 0xff};
    
      data[0] = displayTime.encodeDigit(h / 10);
      data[1] = displayTime.encodeDigit(h % 10) | (Time.second() % 2 ? 0x80 : 0x00);
      data[2] = displayTime.encodeDigit(m / 10);
      data[3] = displayTime.encodeDigit(m % 10);
      displayTime.setSegments(data);

}

Credits

Img 6554 3ywwumwxbh
Ingo Lohs

I am Ingo, well over 40 years and come from the middle of Germany. You can contact me in English or German.

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Map Your Particles!
Easy
  • 499
  • 15

Protip

Locate your Particle Photons, P1s and Electrons on a map without needing extra hardware. Use Ubidots or an offline map alternative

Sending Photos and Video Over the Internet!
Easy
  • 1,964
  • 27

Full instructions

Record video, perform object and face recognition, take a time-lapse or whatever else with a Particle Photon and the 5-megapixel Arducam!

Text Machine, Get Gumball
Easy
  • 54
  • 1

This project describes how to build an Arduino-based, text-controlled gum dispenser

Power Supply Module 3.3V and 5V
Easy
  • 110
  • 0

Protip

First test of a separate Power Supply Module 3.3V and 5V

MyPIR-Sensor Informs Me Via IFTTT
Easy
  • 277
  • 1

Full instructions

Cheap & easy alarm-system.

Running Exercise Track
Easy
  • 79
  • 2

This is a device which can monitor running track via a GPS module and store data to a SD card. And then parse the data later from a app.

Add projectSign up / Login