GlowBit Matrix 8x8 - Python and MicroPython Guide

New guide: “GlowBit Matrix 8x8 - Python and MicroPython”

This guide will cover the basic functionality of the GlowBit Python library when driving a GlowBit Matrix 8x8 module. Enjoy!

Read more

5 Likes

Hi I m following the Glowbit 8*8 matrix beginners guide.

Some of the examples I can get to work some do not.

I was wondering where when I run your example I get a syntax error with this line?

c = matrix.wheel(36*(x y))

2 Likes

Your full code is as follows. Sorry this language is new to me but keen to learn

import glowbit

matrix = glowbit.matrix8x8()

for x in range(8):
    for y in range(8):
        c = matrix.wheel(18*(x y))
        matrix.pixelSetXY(x, y, c)

matrix.pixelsShow()
2 Likes

Try

c = matrix.wheel(36*(x, y))

Notice the comma between the two variables

This example may help you

x = 3
y = 4

print(2*(x, y)) # (3,4,3,4)
print(3*(x, y)) # (3,4,3,4,3,4)

2 Likes

Thanks for that quick and helpful reply. But the learning guide seems to have a few errors?

Cheers

2 Likes

Hey, @Dean276244, and welcome to the forums.

I wish it was under less embarrassing circumstances. We will go ahead and update the guide to fix the mistake.

If you have found other errors, feel free to reply to this comment so we can get them fixed up too.

Thanks Jane, I thought it was me

1 Like

So I am steadily working my way through the Glowbit guides and was wondering is there a way to see the actual code that was used in the various demo modes instead of calling them by say for example pulseDemo() ?

1 Like

I think I answered my own question. The codes for the various demos are in Glowbit.py ?

2 Likes

Hi @Dean276244 ,

Yep! That’s correct, those example functions will be located inside of glowbit.py.

Hi Samuel thanks for the reply and answer to my question.
Could I also ask?
When using WLED and making patterns from a iPhone etc can these patterns then be written to a microcontroller and then run from the microcontroller without the use of a phone running the WLED App?

Cheers Dean

Ps. I have just driven to the Post Office to pickup my latest set of goodies from Core Electronics. Rural are with no postal service, hot and windy too!

Hey @Dean276244 ,

That should be possible! Depending on your exact WLED setup, most WLED-compatible controllers will have an internal memory that can store preset lighting functions through power cycles. Using this method, you can also schedule different lighting effects through your iPhone app to trigger at different times of the day.

If you want to control your WLED instance with a separate microcontroller, this is also possible. Depending on the microcontroller you have in mind, there will either be a WLED API that you can use to do this or instruct your microcontroller to send HTTP requests to the WLED instance directly.

Feel free to tell us more about your setup and the microcontroller you are planning to use if you would like some more help with this!

Just wondering can you use the Pulse function on a matrix? If so how can choose the column or row?

Hey @Dean276244 ,

I’m not sure if you are talking about the pulse function built into glowbit.py or the pulse preset used by WLED. We have a guide for setting up this matrix so that it works well with the WLED preset effects, which may do the trick for you.

If you are talking about the pulseDemo() or similar functions inside of glowbit.py, let us know and we can help out with that as well.

1 Like