Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Scroll pHAT HD #100

Open
thijstriemstra opened this issue Mar 28, 2017 · 8 comments
Open

Support for Scroll pHAT HD #100

thijstriemstra opened this issue Mar 28, 2017 · 8 comments

Comments

@thijstriemstra
Copy link
Collaborator

See https://shop.pimoroni.com/collections/raspberry-pi/products/scroll-phat-hd

scroll_phat_hd_2_of_4_1024x1024

@thijstriemstra
Copy link
Collaborator Author

I'll be able to get my hands on one later this week and test it.

@rm-hull
Copy link
Owner

rm-hull commented Mar 29, 2017

Looks like it is an i2c device, so should be easy to drive

@thijstriemstra
Copy link
Collaborator Author

thijstriemstra commented Jun 12, 2017

Finally got one on my desk, will test this now. @rm-hull where do I start, how do I test this?

@thijstriemstra
Copy link
Collaborator Author

ping @rm-hull

@rm-hull
Copy link
Owner

rm-hull commented Jul 3, 2017

First things first, connect it up, and do i2cdetect -y 1 and see what address(es) it responds with.

Looking at the datasheet and adafruit arduino code, I'd be inclined to hack a little script first to understand it a bit more before diving into writing the display driver. The hack script should:

for x in range(17):
    for y in range(7):
        bus.write_byte(y, x, 0xFF)
        time.sleep(1)

and see what happens - if that worked (in some sense), you should see the LEDs progressively lighting up one by one - and that should give us a clue how to map the display (it will either be a raster scan or snake scan - similar to the WS2812 neopixel mapping on the unicorn HAT - https://github.com/rm-hull/luma.led_matrix/blob/master/luma/led_matrix/device.py#L281-L292)

Once we understand how to address it, writing a luma.led_matrix driver will be pretty simple, and we should be able to convert RGB colored images into greyscale so that the pixels have different brightness levels.

Quite happy to try organising a remote coding session (hangouts / slack / remote desktop
/ screenhero) ?

@dglaude
Copy link

dglaude commented Jan 4, 2018

Is there some status update on this?
I have that hardware and there is a library from @pimoroni .
Do you want a (a) pure independent implementation, (b) it is OK to call their library, (c) it is OK to adapt their code and reuse it (they use MIT license) while removing all the unnecessary part (font, ...)?

@Gadgetoid
Copy link
Collaborator

I most emphatically promote borrowing and re-purposing our code!

If you need any help getting Scroll pHAT HD up and running, I'd be happy to test/review your code and answer any questions you might have.

I'd also love to see support for the Unicorn HAT HD, which uses SPI.

The Scroll pHAT HD pixels aren't addressed in any way that would make sense to standardise, but you can convert X/Y coordinates into an X index into the pixel memory using the _pixel_addr method on this class:

class ScrollPhatHD(Matrix):
    width = 17
    height = 7

    def _pixel_addr(self, x, y):
        if x > 8:
            x = x - 8
            y = 6 - (y + 8)
        else:
            x = 8 - x

        return x * 16 + y

https://github.com/pimoroni/scroll-phat-hd/blob/1637fce37f9d8c353ef8d658792164e1e1ea02a2/library/scrollphathd/is31fl3731.py#L647-L658

@rm-hull
Copy link
Owner

rm-hull commented May 25, 2019

I'd also love to see support for the Unicorn HAT HD, which uses SPI.

@Gadgetoid - see #188 - wip, but is working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants