rm-hull / luma.examples

Companion repo for running examples against the luma.oled, luma.lcd, luma.led_matrix and luma.emulator display drivers.
MIT License
367 stars 140 forks source link

Config file for sh1106 and st7789 (waveshare hat versions) #143

Closed matemaciek closed 3 years ago

iceman1001 commented 3 years ago
Traceback (most recent call last):
  File "bounce.py", line 80, in <module>
    device = get_device()
  File "/home/pi/luma.examples/examples/demo_opts.py", line 63, in get_device
    device = cmdline.create_device(args)
  File "/usr/local/lib/python3.7/dist-packages/luma/core/cmdline.py", line 252, in create_device
    backlight_params = dict(gpio=interface.gpio, gpio_LIGHT=args.gpio_backlight, active_low=args.backlight_active == "low")
AttributeError: 'i2c' object has no attribute 'gpio'

When I try your conf, luma.core seem to want to do a GPIO for lcd,

matemaciek commented 3 years ago
Traceback (most recent call last):
  File "bounce.py", line 80, in <module>
    device = get_device()
  File "/home/pi/luma.examples/examples/demo_opts.py", line 63, in get_device
    device = cmdline.create_device(args)
  File "/usr/local/lib/python3.7/dist-packages/luma/core/cmdline.py", line 252, in create_device
    backlight_params = dict(gpio=interface.gpio, gpio_LIGHT=args.gpio_backlight, active_low=args.backlight_active == "low")
AttributeError: 'i2c' object has no attribute 'gpio'

When I try your conf, luma.core seem to want to do a GPIO for lcd,

Can you share the command you're running?

iceman1001 commented 3 years ago
python3 bounce.py -i spi -d st7789 --gpio-reset 27 --gpio-data-command 25 --gpio-backlight 24 --backlight-active high --spi-bus-speed 52000000
iceman1001 commented 3 years ago

I had uninstall / install core, oled, lcd, examples, and now it works :)