https://github.com/bytekeeper/clock-nanoatmega328
https://github.com/bytekeeper/clock-nanoatmega328
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bytekeeper/clock-nanoatmega328
- Owner: Bytekeeper
- Created: 2017-12-09T07:13:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-09T07:36:59.000Z (over 8 years ago)
- Last Synced: 2025-02-25T09:20:47.463Z (over 1 year ago)
- Language: C++
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# clock-nanoatmega328
Part of a project to build a alarm clock: This part shows the time on a 4 digit 7 segment display using an arduino nano.
## 4 Digit Display Pin Layout
* The display I'm using has 17 pins
* There are 2 common anodes: PIN 1 and PIN 2
* PIN 3 is dead
* PIN 4 - 17 display different segments depending on which anode is active
The following table shows which segments associations:
DIGIT 1
DIGIT 2
DIGIT 3
DIGIT 4
Anode
PIN 4
PIN 5
PIN 6
PIN 7
PIN 8
PIN 9
PIN 10
PIN 11
PIN 12
PIN 13
PIN 14
PIN 15
PIN 16
PIN 17
PIN 1
a,g
c
e
d
c
dots
e
d
c
e
d
c
PIN 2
e,d
b
f
a
g
b
g
f
a
b
f
g
a
b
## Implementation
* Anode 1 and 2 are switched back and forth
* For each switch, the required pins (segments) for each digit are switched on for a short time and then switched off, lighting up at most 1 digit
** This way, it's never drawing too much power from the output pins of the Arduino
** It's kind of a PWM and by changing the delays I can make the display darker or brighter
* Every half second, the dots are switched
* Every minute, the clock automatically "ticks"
* It's an I2C slave to an ESP8266 master node, which will update the clock based on some other time source