Giter Club home page Giter Club logo

wt32sc01py's Introduction

Python WT32SC01 Plus driver in MicroPython

This is a fork of devbis' st7789py_mpy module from https://github.com/devbis/st7789py_mpy.

This driver adds support for:

  • The WT32SC01 Plus 8 bit parallel display
  • Display rotation
  • Hardware based scrolling
  • Drawing text using 8 and 16 bit wide bitmap fonts with heights that are multiples of 8. Included are 12 bitmap fonts derived from classic pc BIOS text mode fonts.
  • Drawing text using converted TrueType fonts.
  • Drawing converted bitmaps

The driver is not fast but it is written in pure MicroPython. It is functional but is also a work in progress. Documentation can be found in the docs directory and online at https://penfold.owt.com/wt32sc01py

Examples

See the examples directory for example programs that run on the WT32SC01 Plus. Some of the examples require additional modules to be available to run, see the import lines in the examples source code.

Fonts

See the subdirectories in the fonts directory for the converted font modules used in the examples. These modules can be compiled using the mpy-cross compiler before uploading to save memory.

wt32sc01py's People

Contributors

russhughes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

wt32sc01py's Issues

clear() doesn't work with 565 encoded color

The comment for clear() is somewhat confusing, but implies that this method can accept a 565 encoded color. This doesn't work as expected because if a 16 bit colour is passed in, only the lower 8 bits will be used, giving unexpected results. Instead, to clear the display to a particular colour, this method requires an 8-bit colour value in the format RRRBBGGG.

Demonstration:

import wt32sc01py as wt32
import time
tft = wt32.WT32SC01(0)
tft.clear(wt32.RED)  # expected red, got black
time.sleep(3)
tft.clear(0b11100000)  # got red
time.sleep(3)
tft.clear(wt32.GREEN) # expected green, got red 
time.sleep(3)
tft.clear(0b00000111)  # got green
time.sleep(3)
tft.clear(wt32.BLUE)  # expected blue, got cyan
time.sleep(3)
tft.clear(0b00011000)  # got blue
time.sleep(3)

File "wt32sc01py.py", line 636, in clear NameError: name 'rmt' isn't defined

WT32SC01 Plus
MicroPython v1.20.0 on 2023-04-26; ESP32S3 module (spiram) with ESP32S3

russhughes/wt32sc01py (Download 2023-Sep-15)
With hello.py or chango.py or lines.py... with Thonny 4.1.1 on Mac Book with Intel CPU I get the error

Traceback (most recent call last):
File "", line 35, in
File "", line 21, in main
File "wt32sc01py.py", line 636, in clear
NameError: name 'rmt' isn't defined

But in wt32sc01py.py:

from esp32 import RMT
...
def init(self,rotation=0,rotations=ROTATIONS,):
...
self.rmt = RMT(0, pin=self.wr, clock_div=1) <<< Line 338
...
def clear(self, color=None):
...
for _ in range(count * 2):
rmt.write_pulses(2, pulses) <<<Line 636
rmt.wait_done()
...

All looks good, what's wrong ???

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.