Skip to content

Commit

Permalink
Implemented the first functional Display interface
Browse files Browse the repository at this point in the history
Implemented the first functional Display interface with the print,
fade in and fade out effects.
  • Loading branch information
sergiosagu committed May 21, 2021
1 parent 52ad5f4 commit 43cea4d
Show file tree
Hide file tree
Showing 6 changed files with 404 additions and 95 deletions.
127 changes: 34 additions & 93 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,104 +1,45 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# Created by https://www.toptal.com/developers/gitignore/api/c++
# Edit at https://www.toptal.com/developers/gitignore?templates=c++

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot
### C++ ###
# Prerequisites
*.d

# Django stuff:
*.log
local_settings.py
db.sqlite3
# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Flask stuff:
instance/
.webassets-cache
# Precompiled Headers
*.gch
*.pch

# Scrapy stuff:
.scrapy
# Linker files
*.ilk

# Sphinx documentation
docs/_build/
# Debugger Files
*.pdb

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py
# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Fortran module files
*.mod
*.smod

# Spyder project settings
.spyderproject
.spyproject
# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Rope project settings
.ropeproject
# Executables
smartdisplay

# mkdocs documentation
/site
# End of https://www.toptal.com/developers/gitignore/api/c++

# mypy
.mypy_cache/
# VS Code Files
.vscode
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
CC = g++

ifdef RPI
CFLAGS = -Wall -pthread -lwiringPi
WPIFLAG = -DWPI
else
CFLAGS = -Wall -pthread
WPIFLAG =
endif

default: smartdisplay

smartdisplay: smartdisplay.o displays.o
$(CC) $(CFLAGS) -o smartdisplay smartdisplay.o displays.o

smartdisplay.o: smartdisplay.cpp
$(CC) $(CFLAGS) -c smartdisplay.cpp

displays.o: displays.cpp displays.hpp
$(CC) $(CFLAGS) -c displays.cpp $(WPIFLAG)

clean:
$(RM) smartdisplay *.o *~ *.h*.gch

push:
@echo "RPI_IP='"$(RPI_IP)"'"
scp Makefile *.hpp *.cpp root@$(RPI_IP):~/smartdisplay/
55 changes: 53 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,53 @@
# smartdisplay
[WIP] SmartDisplay DIY project
# Smart Display
My attempt to build a useful-ish DIY smart device with few components which I have had hanging around for a while:
- A **Raspberry Pi Zero W** (using the WiringPi library)
- A **Samsung 16LF01UA3** VFD Module (16-segment 16 characters)
- A **Futaba M16MY02A** VFD Module (14-segments 16 characters)
- A **Noritake GU96x8M-K609C1** VFD Module (96x8 graphic dot matrix)
- The bare minimum electronics to interconnect those with each other :-)
## Components
### displays.hpp displays.cpp
These define the interface and implementation related to the VFD modules. Essentially, they provide the functionality to display the data in different ways. Some examples are:
- Print a message.
- Slide a text left-to-right and right-to-left.
- Blink a message.
- Fade-in, fade-out and blink with fade effect a message.
- "Crack" a message, like deciphering it.
- Print a text like in a terminal.
### smartdisplay.cpp
Main application combining the previous functionality.
## Build & Run
Build the project (no WiringPi library needed)
```
$ make
```
Push the sources to your Raspberry Pi (to `/root/smartdisplay/`)
```
$ make push RPI_IP=172.16.0.1
```
Build the project from your Raspberry Pi (WiringPi library needs to be installed)
```
$ make RPI=true
```
Run the project
```
$ ./smartdisplay
```
Clean the project
```
$ make clean
```
## Result
*Coming soon!*
# Related work
This project is an evolution of https://github.com/sergiosagu/arduino

## Scratchpad
Turn on the built-in led
```
$ echo 255 | sudo tee /sys/class/leds/led0/brightness
```
Turn off the built-in led
```
$ echo 0 | sudo tee /sys/class/leds/led0/brightness
```
Loading

0 comments on commit 43cea4d

Please sign in to comment.