Skip to content

Commit

Permalink
Merge pull request #86 from hwiguna/CYD-RollingClock
Browse files Browse the repository at this point in the history
Initial
  • Loading branch information
witnessmenow authored Dec 5, 2023
2 parents 22ac3ea + a6b1cdf commit 86eaeb4
Show file tree
Hide file tree
Showing 5 changed files with 468 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Examples/Projects/RollingClock/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
creds.h
66 changes: 66 additions & 0 deletions Examples/Projects/RollingClock/Digit.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#include "Digit.h"

Digit::Digit(int value)
{
m_value = value;
m_newValue = value;
m_frame = 0;
}

int Digit::Value()
{
return m_value;
}

int Digit::Value(int value)
{
m_value = value;
m_newValue = value;
return m_value;
}

int Digit::NewValue()
{
return m_newValue;
}

int Digit::NewValue(int newValue)
{
m_newValue = newValue;
return m_newValue;
}

int Digit::Frame()
{
return m_frame;
}

int Digit::Frame(int frame)
{
m_frame = frame;
return m_frame;
}

int Digit::Height()
{
return m_height;
}

int Digit::Height(int height)
{
m_height = height;
return m_height;
}

void Digit::SetXY(int x, int y)
{
m_x = x;
m_y = y;
}

int Digit::X() { return m_x; };
int Digit::Y() { return m_y; };

Digit::~Digit()
{
}
27 changes: 27 additions & 0 deletions Examples/Projects/RollingClock/Digit.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

class Digit
{
private:
int m_value;
int m_newValue;
int m_frame;
int m_height;
int m_x;
int m_y;

public:
Digit(int value);
~Digit();
int Value();
int Value(int value);
int NewValue();
int NewValue(int newValue);
int Frame();
int Frame(int frame);
int Height();
int Height(int height);
void SetXY(int x, int y);
int X();
int Y();
};

5 changes: 5 additions & 0 deletions Examples/Projects/RollingClock/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# CYD ROLLING CLOCK
This example shows a digital clock with a rolling effect as the digits change.
Most of the code are borrowed from other examples. Thanks Internet!

You will have to modify the PREFERENCES section in RollingClock.ino to your WiFi and TimeZone.
Loading

0 comments on commit 86eaeb4

Please sign in to comment.