# New Scrollphat HD compatible with code written for old scrollphat?

**URL:** <https://forums.pimoroni.com/t/new-scrollphat-hd-compatible-with-code-written-for-old-scrollphat/4096>\
**Category:** Raspberry Pi\
**Created:** [March 1, 2017, 8:34am UTC](https://forums.pimoroni.com/t/new-scrollphat-hd-compatible-with-code-written-for-old-scrollphat/4096 "2017-03-01T08:34:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frassepe](https://avatars.discourse-cdn.com/v4/letter/f/9fc29f/32.png) [@Frassepe](https://forums.pimoroni.com/u/Frassepe)\
**Post date:** [March 1, 2017, 8:34am UTC](https://forums.pimoroni.com/t/new-scrollphat-hd-compatible-with-code-written-for-old-scrollphat/4096/1 "2017-03-01T08:34:08Z")

</div>

Hi!

Exiting news about the new scrollphat HD!

Will code written for the old scrollphat work as is or does it need to be adjusted in some way?

Cheers

---

<div class="post-metadata">

**Author:** ![RogueM](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/roguem/32/311_2.png) [@RogueM](https://forums.pimoroni.com/u/RogueM)\
**Post date:** [March 1, 2017, 10:37am UTC](https://forums.pimoroni.com/t/new-scrollphat-hd-compatible-with-code-written-for-old-scrollphat/4096/2 "2017-03-01T10:37:31Z")

</div>

it’s a different chip entirely, driven by an entirely different custom library, so some adapting will be needed.

It could be as simple as:

`import scrollphathd as scrollphat`  
or  
`from scrollphathd import clear, show, scroll, set_pixel`  
(replacing `scrollphat` by `scrollphathd` at the top of your code)

but that will depend on the existing code.

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [March 1, 2017, 11:55am UTC](https://forums.pimoroni.com/t/new-scrollphat-hd-compatible-with-code-written-for-old-scrollphat/4096/3 "2017-03-01T11:55:34Z")

</div>

I ported the Scroll pHAT advanced scrolling example with very little trouble- the APIs are designed to be as close as possible, while ditching some of the things that bugged me about the Scroll pHAT. Moving your code over should be as easy as @RogueM suggests.

---

<div class="post-metadata">

**Author:** ![Frassepe](https://avatars.discourse-cdn.com/v4/letter/f/9fc29f/32.png) [@Frassepe](https://forums.pimoroni.com/u/Frassepe)\
**Post date:** [March 1, 2017, 12:32pm UTC](https://forums.pimoroni.com/t/new-scrollphat-hd-compatible-with-code-written-for-old-scrollphat/4096/4 "2017-03-01T12:32:04Z")

</div>

Thanks guys.

What parts where ditched (and even annoying) ?

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [March 1, 2017, 1:43pm UTC](https://forums.pimoroni.com/t/new-scrollphat-hd-compatible-with-code-written-for-old-scrollphat/4096/5 "2017-03-01T13:43:09Z")

</div>

The whole Scroll pHAT library was an abomination far too closely coupled with the hardware ;)

Which necessitated things like this: [https://github.com/pimoroni/scroll-phat/blob/master/library/scrollphat/IS31FL3730.py#L26-L38](https://github.com/pimoroni/scroll-phat/blob/master/library/scrollphat/IS31FL3730.py#L26-L38)

Actually, it was so bad that it never had the “advanced scrolling” example I mentioned- just remembered I ported that from Microdot pHAT.

I was actually in the process of rewriting the Scroll pHAT library from scratch to adopt the techniques I used in Microdot pHAT, I might still finish it :D - [https://github.com/pimoroni/scroll-phat-redux](https://github.com/pimoroni/scroll-phat-redux)

---

<div class="post-metadata">

**Author:** ![Frassepe](https://avatars.discourse-cdn.com/v4/letter/f/9fc29f/32.png) [@Frassepe](https://forums.pimoroni.com/u/Frassepe)\
**Post date:** [March 1, 2017, 2:07pm UTC](https://forums.pimoroni.com/t/new-scrollphat-hd-compatible-with-code-written-for-old-scrollphat/4096/6 "2017-03-01T14:07:26Z")

</div>

Thanks for the info!

Another qustion;  
I’d like to 3d print some sort of diffuser, and was wandering what the distance is between each led?
