Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Hallowing m0
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Hallowing m0

by Teddygag on Fri Aug 07, 2020 1:44 pm

Can someone please write a simple turtle graphics program in python to draw to the hallowing display. I have tried myself and all I get is a black display. No error messages. I’m sure it’s because the backlight is turned off. I don’t know how to turn it on with python. Then maybe my turtle graphics will show up.

Teddygag
 
Posts: 15
Joined: Thu Feb 20, 2020 5:31 pm

Re: Hallowing m0

by dastels on Fri Aug 07, 2020 6:01 pm

There's this I wrote a while ago https://learn.adafruit.com/circuitpython-turtle-graphics, though it probably won't fit on an M0.

An example of manipulating the backlight is shown in this project. See around lines 85-106. https://learn.adafruit.com/hallowing-jump-scare-trap/code-with-circuitpython

Dave

dastels
 
Posts: 3532
Joined: Tue Oct 20, 2015 3:22 pm

Re: Hallowing m0

by Teddygag on Fri Aug 07, 2020 6:45 pm

Thanks Dave. Can you use that super power you have for code and isolate the exact code I need to turn on the tft display and nothing else. I want to make this a function I can include as I experiment with the turtle graphics. I simply can not separate out exactly what I need from the second program you specified.

It is strange to me that the simple turtle program of a few lines makes it run out of memory while the huge second program does not. What am I missing. The hallowing has 8gigs of memory.

Teddygag
 
Posts: 15
Joined: Thu Feb 20, 2020 5:31 pm

Re: Hallowing m0

by Teddygag on Fri Aug 07, 2020 7:31 pm

Yup, you are correct. The 15 line code to draw a simple square returns a memory allocation error.

In the larger second program of 152 lines of code, I get the error:

code.py output:
Traceback (most recent call last):
File "code.py", line 86, in <module>
ValueError: TFT_BACKLIGHT in use

I can go no further to test out the backlight code.

help please ?

Teddygag
 
Posts: 15
Joined: Thu Feb 20, 2020 5:31 pm

Re: Hallowing m0

by dastels on Fri Aug 07, 2020 10:07 pm

Hmm.. I'm not sure yet what's going on.

Code: Select all | TOGGLE FULL SIZE
>>> import board
>>> import pulseio
>>> backlight = pulseio.PWMOut(board.TFT_BACKLIGHT)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: TFT_BACKLIGHT in use
>>>


Ok. It's used by board.DISPLAY which gives you access to it.

Code: Select all | TOGGLE FULL SIZE
>> display = board.DISPLAY
>>> display.brightness = 0.5
>>> display.brightness = 0.0
>>> display.brightness = 1.0


That should give you what you need.

Dave

dastels
 
Posts: 3532
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.