rm-hull/luma.led_matrix

Depreciated version no installing correctly via 'sudo pip install max7219'

Closed this issue · 17 comments

Hi,
I am still using the depreciated version of the s/w installing via 'sudo pip install max7219'. I have just done a clean install for the first time in a while and it did not work - that is it reported it had installed correctly but nothing was displayed when I ran my existing python app or one of your test examples.

When I tried re-installing via the longer route from your github site it now seems to work ? I guess my question is has anything changed that you know of that could stop the pip install method working ?

I am going to try it with an older version of Rasbian to check that it not the issue

Use pip install luma.led_matrix instead.

Thanks but I cannot see that working - unfortunately my code is dependent on features only available in the old max7219 variant of the code

Porting it over should be trivial, can you show some of your code?

The problem is that I use a function to control individual LEDs in the matrix - for instance self.device.pixel(col, row, id, redraw)
Which are not available in updated versions

@DavidMS51 not sure if it's not available in the newer version, maybe @rm-hull has an idea.

It's not unfortunately - I checked in with him when he made the initial change

@DavidMS51 can you paste the console output of what you did or trying to do? errors and log etc

@DavidMS51 - the old pixel method could be simulated by creating (and holding onto) a blank 8x8 Pillow image, and then calling any number of image.putpixel((x, y), 1) to set pixels followed by device.display(image).

To blank out a pixel: image.putpixel((x, y), 0) followed by device.display(image).

See http://pillow.readthedocs.io/en/4.3.x/reference/Image.html#PIL.Image.Image.putpixel

Thanks I guess this is the push I need to update the code !

I have got it installed and managed to get an individual pixel to flash on an off. I'm not quite sure what you mean by 'holding onto' the Pillow image but I guess this will be come clear at some stage !

One Thought you might want to update your instructions in terms of accessing the legacy version to suggest users will have problems with recent versions of Raspbian

Please create a pull request with these changes so we can incorporate them @DavidMS51

@DavidMS51 to make a pull request: use github to find the file you want to edit and click the edit button to make changes in the browser and press save/create pull request, and et voila.

Any chance someone can give me a quick explanation on how this works:

"The old pixel method could be simulated by creating (and holding onto) a blank 8x8 Pillow image, and then calling any number of image.putpixel((x, y), 1) to set pixels followed by device.display(image).

To blank out a pixel: image.putpixel((x, y), 0) followed by device.display(image)."

New to programming and trying to make a the leds light up one by one in quick succession.

Try having a look at my updated TFwordclock code - it will give you a working example to start from
https://github.com/DavidMS51/TFWordclock/blob/master/timewrd5ca_eng.py