Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CS Fancy Clock
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TheJoeCoder
CS Fancy Clock
Commits
803e2f5d
Verified
Commit
803e2f5d
authored
11 months ago
by
TheJoeCoder
Browse files
Options
Downloads
Patches
Plain Diff
Add readme and fullscreen option
parent
0efa7cf7
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+27
-0
27 additions, 0 deletions
README.md
config.py
+2
-0
2 additions, 0 deletions
config.py
main.py
+7
-1
7 additions, 1 deletion
main.py
with
36 additions
and
1 deletion
README.md
0 → 100644
+
27
−
0
View file @
803e2f5d
# cs-fancy-clock
A simple clock that displays the current time in a fancy way.
## Installation (on Pi Zero W)
Use Wayland for the display server, especially if you're using an SPI display. X11 may also be too slow.
```
bash
cd
~
git clone https://git.rb9.xyz/TheJoeCoder/cs-fancy-clock
cd
cs-fancy-clock
sudo
apt-get
install
python3 python3-dev python3-pip python3-pygame
python3
-m
venv .venv
# Install the requirements
# Omit the -r requirements.neopixel.txt if you don't have a neopixel strip
./.venv/bin/pip
install
-r
requirements.txt
-r
requirements.neopixel.txt
# Change access permissions for Wayland (insecure but necessary)
xhost +SI:localuser:root
# Run the clock
sudo
./.venv/bin/python3 main.py
```
\ No newline at end of file
This diff is collapsed.
Click to expand it.
config.py
+
2
−
0
View file @
803e2f5d
PROP_SCREEN_WIDTH
=
240
PROP_SCREEN_WIDTH
=
240
PROP_SCREEN_HEIGHT
=
280
PROP_SCREEN_HEIGHT
=
280
PROP_WINDOW_FULLSCREEN
=
False
# Make the window scale larger for development
# Make the window scale larger for development
PROP_WINDOW_SCALE
=
3
PROP_WINDOW_SCALE
=
3
...
...
This diff is collapsed.
Click to expand it.
main.py
+
7
−
1
View file @
803e2f5d
...
@@ -82,7 +82,13 @@ def load_pattern(pattern_name: str, leds: ILedString):
...
@@ -82,7 +82,13 @@ def load_pattern(pattern_name: str, leds: ILedString):
def
run_screen
():
def
run_screen
():
# Initialise Pygame and create a window
# Initialise Pygame and create a window
pygame
.
init
()
pygame
.
init
()
screen
=
pygame
.
display
.
set_mode
((
PROP_SCREEN_WIDTH
*
PROP_WINDOW_SCALE
,
PROP_SCREEN_HEIGHT
*
PROP_WINDOW_SCALE
))
pg_options
=
0x0
if
PROP_WINDOW_FULLSCREEN
:
pg_options
|=
pygame
.
FULLSCREEN
screen
=
pygame
.
display
.
set_mode
(
(
PROP_SCREEN_WIDTH
*
PROP_WINDOW_SCALE
,
PROP_SCREEN_HEIGHT
*
PROP_WINDOW_SCALE
),
pg_options
)
pygame
.
display
.
set_caption
(
"
Clock
"
)
pygame
.
display
.
set_caption
(
"
Clock
"
)
# Init widgets
# Init widgets
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment