Giter VIP home page Giter VIP logo

hyperpixel-4.0-square's Introduction

HyperPixel 4.0 Square

Examples for Pimoroni's HyperPixel 4.0 Square high-resolution, high-speed, 4.0" display with optional touchscreen for Raspberry Pi written in Python 3.

Python Description
3.7 development on macos
3.9 testing on Raspberry Pi Zero
3.9 testing on Raspberry Pi 4

Table of contents/examples

Note

You can adapt, improve and use the code for your projects as you wish. The author of this repository take no responsibility for your use or misuse or any damage on your devices!

Usage

Run application form terminal

You can run all examples in this form.

# change into HOME
$ cd ~

# clone repository
$ git clone https://github.com/Lupin3000/HyperPixel-4.0-Square.git

# change into example (eq. clock)
$ cd ~/HyperPixel-4.0-Square/tk_modules/

# execute (stop with <ESCAPE>)
$ python3 hyperclock.py

Install fonts

Please note that the fonts are only available for private use (see www.1001freefonts.com)!

# create directory
$ mkdir ~/.fonts

# copy all fonts
$ cp ~/HyperPixel-4.0-Square/*.ttf ~/.fonts/

Autostart application

# create directory
$ mkdir -p ~/.config/autostart

# create desktop file
$ touch ~/.config/autostart/display.desktop

Example for display.desktop

[Desktop Entry]
Type=Application
Name=HyperWeather
Exec=/usr/bin/python3 ~/HyperPixel-4.0-Square/tk_modules/hyperweather.py

Raspberry Bullseye

On bullseye you don't need to install any library/package for Hyperpixel! Also, i2c don't need to be enabled. The only thing you need to do, is to add one line in /boot/config.txt.

# start editor
$ sudo vim /boot/config.txt

Example of /boot/config.txt to enable hyperpixel display:

# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
dtoverlay=vc4-kms-dpi-hyperpixel4sq

Restart the device and the display should work!

Install python dependencies

# install via pip from file
$ pip3 install -r requirements.txt

# verify installed pip packages (optional)
$ pip3 freeze

Install packages for speach recognition

Depend on API you like to use!!!

# minimum needed packages
$ sudo apt install espeak python3-pyaudio

# optional or if issues (sphinx)
$ sudo apt install flac pavucontrol libportaudio2 libportaudiocpp0 portaudio19-dev
$ sudo apt install swig libpulse-dev bison libasound2-dev alsa-utils gcc python3-pocketsphinx
# list playback hardware devices
$ aplay -l

# list capture hardware devices
$ arecord -l

Error

If you failed and see error like "No module named cv2"

# update apt and install needed apt packages
$ sudo apt update && sudo apt install python3-opencv

# verify installation (optional)
$ python3 -c "import cv2"

If you failed and see error like "cannot import name ImageTk from PIL"

# update apt and install needed apt packages
$ sudo apt update && sudo apt install python3-pil python3-pil.imagetk

# verify installation (optional)
$ python3 -c "from PIL import ImageTk"

hyperpixel-4.0-square's People

Contributors

lupin3000 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.