Coder Social home page Coder Social logo

circuitpython_gc9a01_demos's Introduction

CircuitPython GC9A01 demos

Demos showing how to use CircuitPython displayio driver for GC9A01-based round LCDs. This driver is available in the CircuitPython Community Bundle, or you can install it by hand by copying the gc9a01.py file to your CIRCUITPY/lib directory, or use circup install gc9a01.

Usage

import board
import displayio
import gc9a01
# Raspberry Pi Pico pinout, one possibility, at "southwest" of board
tft_clk = board.GP10 # must be a SPI CLK
tft_mosi= board.GP11 # must be a SPI TX
tft_rst = board.GP12
tft_dc  = board.GP13
tft_cs  = board.GP14
tft_bl  = board.GP15
spi = busio.SPI(clock=tft_clk, MOSI=tft_mosi)
display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=tft_rst)
display = gc9a01.GC9A01(display_bus, width=240, height=240, backlight_pin=tft_bl)

# ... normal circuitpython displayio stuff

Installation

Each of the .py files in "examples" is its own demo. Copy one of these to be your CIRCUITPY's "code.py", like:

cp gc9a01_hellocircles.py /Volumes/CIRCUITPY/code.py

You'll need to install various libraries. Most notably the gc9a01 library. You may also need the adafruit_display_text and adafruit_imageload, depending on the example. The easiest way to install these is from a terminal:

circup install gc9a01
circup install adafruit_display_text
circup install adafruit_imageload

Examples

Check out the 'examples' directory for complete examples:

  • 'gc9a01_helloworld' -- shows one way of doing polar coordinates
  • 'gc9a01_hellocircles' -- similar to above but with floating circles using vectorio
  • 'gc9a01_picture_locket' -- display a series of pictures, makes a nice locket if used with a QT Py Haxpress
  • 'gc9a01_gauge_knob' -- round dial gauge using gauge background & dial bitmaps, showing bitmaptools.rotozoom

The examples attempt to auto-detect the board you're using. The currently detected boards:

Eyeballs demos

Additionally, there are several demos in the "examples/eyeballs" directory that use these round displays to make moving eyes.

  • 'eyeballs/qteye.py' -- single eyeball (or two eyeballs wired in parallel) on a QT PY RP2040 or similar
  • 'eyeballs/qtpy_person_sensor.py' -- single eyeball that tracks your face, thanks to a Person Sensor module
  • 'eyeballs/gc9a01_lizard_eye.py' -- similar to "qteye" but uses a cool lizard eye (thx @DJDevon3!)
  • 'eyeballs/gc9a01_multi_eyeball.py' -- independent multiple eyes usigng a recompiled CircuitPython

Wiring

Wiring is dependent on board you're hooking it up to. The "SCL" and "SDA" lines need to be hooked up to SPI pins "SCK" and "MOSI/TX". The gc9a01_helloworld.py has example wirings for three different boards. Here is an example for the Pico:

  • VCC - Pico 3.3V(out)
  • Gnd - Pico Ground
  • SCL - Pico GP10 (SPI1 SCK)
  • SDA - Pico GP11 (SPI1 TX)
  • RES - Pico GP12
  • DC - Pico GP13
  • CS - Pico GP14
  • BLK - Pico GP15 (can be omitted if you don't need backlight brightness control)

Here is an example for a QT Py Haxpress:

  • VCC - QT Py 3.3V
  • Gnd - QT Py Ground
  • SCL - QT Py SCK
  • SDA - QT Py MO
  • RES - QT Py TX
  • DC - QT Py A3
  • CS - QT Py A2
  • BLK - unconnected

Building your own dial gauges

There is a partial Python port of @bikerglen's gauge-generator in docs/gauge-generator. These scripts use the wonderful Wand Python wrapper for ImageMagick's C API.

Future Project Ideas:

  • bargraph display using vectorio

Notes to self:

circuitpython_gc9a01_demos's People

Contributors

djdevon3 avatar lzrd avatar todbot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

circuitpython_gc9a01_demos's Issues

Help wanted: Showing RPI OS GUI on 240x240 GC9A01 lcd screen โŒš

Any idea how to do it?

I just want to play a video on the small round screen.
I am connected via SPI, rpi 3 b, and managed to show an image, that's it.

Showing the GUI and running omxplayer sounded like a good idea.
But also, showing the video via a python script sounds great.

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.