# Rainbow HAT fault with 14 segment alphanumeric display?

**URL:** https://forums.pimoroni.com/t/rainbow-hat-fault-with-14-segment-alphanumeric-display/3800
**Category:** Electronics
**Created:** [January 15, 2017, 4:14pm UTC](https://forums.pimoroni.com/t/rainbow-hat-fault-with-14-segment-alphanumeric-display/3800 "2017-01-15T16:14:33Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![badboybubby](https://avatars.discourse-cdn.com/v4/letter/b/e9c0ed/32.png) [@badboybubby](https://forums.pimoroni.com/u/badboybubby)
#### Post date: [January 15, 2017, 4:14pm UTC](https://forums.pimoroni.com/t/rainbow-hat-fault-with-14-segment-alphanumeric-display/3800/1 "2017-01-15T16:14:33Z")

</div>

Hello,

I wondered if I’m being a bit daft but whenever a 5 is displayed on the display, it doesn’t look right?

Instead of the traditional 5 I get something like this?  
…  
|\_\_  
\_\_\_\

Hope that makes sense?

If not I’ll take a picture…

Cheers

Scott

---

<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: [January 15, 2017, 5:07pm UTC](https://forums.pimoroni.com/t/rainbow-hat-fault-with-14-segment-alphanumeric-display/3800/2 "2017-01-15T17:07:30Z")

</div>

Are you using the Python API or Android Things?

Sounds like it’s using one of the diagonals not typical on a 7-segment display to make a 5 that’s stylistically different from a capital S.

In the code, the 5 is `'5': 0b0010000001101001,`

Versus ‘S’ which is `'S': 0b0000000011101101,`

Although the S doesn’t look traditional either, since it’s got 6 bits set, not 5 (top, top left, middle, bottom right, bottom)

I don’t have one to look at right now, so a picture may help!

---

<div class="post-metadata">

### Author: ![badboybubby](https://avatars.discourse-cdn.com/v4/letter/b/e9c0ed/32.png) [@badboybubby](https://forums.pimoroni.com/u/badboybubby)
#### Post date: [January 15, 2017, 5:11pm UTC](https://forums.pimoroni.com/t/rainbow-hat-fault-with-14-segment-alphanumeric-display/3800/3 "2017-01-15T17:11:28Z")

</div>

![New photo by Scott Fleming [BadBoyBubby]](https://lh3.googleusercontent.com/nkJAzQ7q4N_qOkZGGuiYP0heoeW04ERHeBg-LJ42rD4DDCfjgFlIi-BRrDk3cLeMpC8cBqjTtrzcSKoTE_QAiRZmnqQx4pWNl1te6v8C41gDM5JPp0Htwo-LjKlj21wPKBQriyuLLQg=w600-h315-p-k)

I’m using the python API

cheers

---

<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: [January 15, 2017, 5:14pm UTC](https://forums.pimoroni.com/t/rainbow-hat-fault-with-14-segment-alphanumeric-display/3800/4 "2017-01-15T17:14:05Z")

</div>

Ah, that will be why ‘S’ has 6 bits set!

You can modify the Python library to replace the value for ‘5’ with the one from ‘S’ if you want the traditional style :D

---

<div class="post-metadata">

### Author: ![badboybubby](https://avatars.discourse-cdn.com/v4/letter/b/e9c0ed/32.png) [@badboybubby](https://forums.pimoroni.com/u/badboybubby)
#### Post date: [January 15, 2017, 5:16pm UTC](https://forums.pimoroni.com/t/rainbow-hat-fault-with-14-segment-alphanumeric-display/3800/5 "2017-01-15T17:16:54Z")

</div>

Thanks gadgetoid, that’s a little beyond my skill set and to be honest I’m cool with it, I really just wanted to make sure it wasn’t faulty hardware.

ps. it’s a brilliant piece of kit, I love it!

thanks again for such a swift response…

scott

---

<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: [January 15, 2017, 5:56pm UTC](https://forums.pimoroni.com/t/rainbow-hat-fault-with-14-segment-alphanumeric-display/3800/6 "2017-01-15T17:56:51Z")

</div>

Haha, no problem!

It’s easier than it sounds, by the way ;)

I was looking over the font defined here: [https://github.com/pimoroni/rainbow-hat/blob/master/library/rainbowhat/alphanum4.py](https://github.com/pimoroni/rainbow-hat/blob/master/library/rainbowhat/alphanum4.py)

Each letter is defined as a sequence of 16 bits, each of which corresponds to a segment on the display.
