Skip to content

Can't draw on LCD screen #463

@obo

Description

@obo

I'm trying to draw the smiley-frowney demo mentioned in #194 on the LCD screen of my EV3.

  • ev3dev version: 4.14.35-ev3dev-2.0.0-ev3
  • ev3dev-lang-python version: (don't know how to get, I'm rather new to python)

The demo code I used is this:

#!/usr/bin/env python3
# from https://github.com/ev3dev/ev3dev-lang-python/issues/194

from time import sleep
import ev3dev.auto as ev3

screen = ev3.Screen()

smile = True

while True:
    screen.clear()

    # Screen.draw returns a PIL.ImageDraw handle
    screen.draw.ellipse(( 20, 20,  60, 60))
    screen.draw.ellipse((118, 20, 158, 60))

    if smile:
        screen.draw.arc((20, 80, 158, 100), 0, 180)
    else:
        screen.draw.arc((20, 80, 158, 100), 180, 360)

    smile = not smile

    # Update lcd display
    screen.update()

    sleep(1)

I can run this from ssh using this trick:

sudo openvt -s -w -- sudo --user robot -- ./draw-smiley-frowney.py

The LCD goes blank, then quickly shows a tiny error message and I get Brickman again.

When I run the demo from Brickman, the error log is collected, so I can read the message:

robot@ev3dev:~/lego/random-bits$ cat draw-smiley-frowney.py.err.logTraceback (most recent call last):
  File "/home/robot/lego/random-bits/draw-smiley-frowney.py", line 26, in <module>
    screen.update()
  File "/usr/lib/python3/dist-packages/ev3dev/core.py", line 3325, in update
    raise Exception("Not supported")

(The simpler demo http://www.ev3dev.org/docs/tutorials/using-ev3-lcd/ behaves similarly, screen goes blank, debug prints get printed, no error is reported but nothing is drawn on screen.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions