I have been very much taken with the inkypHAT from Pimoroni and was really excited when I got mine back in January 2018. For only £22 you get a full 212 x 104 three colour eInk display which produces great clear and crisp graphics and text.

There have been many projects I have wanted to make and my first was a name badge I wore to BETT back in January.

A second project I have been keen to make was a Bible verse a day display screen for my desk to give me encouraging verses during the day. I soon discovered that this wasn’t going to be the easiest task as I needed a simple way of converting long strings to multi line text.

IMG_0728


If you would like a copy of the code it is available here on GitHub

This project can easily be used for other purposes and is very useful if you want to be able to display a long piece of text over the whole display at different font sizes. I have included a step which calculates the average character width for the current font so calculates automatically how many characters can fit onto one line and where to split the string into the correct line lengths.

Example 1: calculating the average character width and the number of characters which will fit on the display
Example 2: selecting a random verse from the list and splitting it into the correct length lines
Example 3: dealing with the ends of lines to ensure that split words have a dash

view rawexample1.py hosted with ❤ by GitHub

view rawexample2.py hosted with ❤ by GitHub

view rawexample3.py hosted with ❤ by GitHub

7 Responses

  1. Hello, I like the website : ) I’ve tried both versions of this bible code and I can’t get it to work. It behaves like its going to work when I run it and doesn’t give me any errors but my inky phat just stays blank. Is there anyway you can point me in the right direction? Does the quote file need to be in a certain format? Thank you for your time.

    1. Hi, it might be that I wrote this a little while back and the libraries have been updated.
      This might sounds a silly question but do some of the sample Pimoroni scripts work?

      1. I really wanted to make a digital daily bread type thing and the way you did it was so perfect. I can sit down and learn all the python needed to do this but… I’ll be at it for a while lol I really hope I can get this going, thank you for any help : )

      2. Hello Spencer, I’m not sure if my last comment got through but yeah the examples worked great! I apologize if I’m being a pester I don’t mean to be and if you’re to busy for this I would completely understand. I would be very thankful and even willing to send a bit of funds your way if we could get this working again. I’m working on getting better with python as my mother language is C/C++ so I’m not a total noob and wouldn’t bog you down to much. Thank you for your time and wonderful work good sir. God bless you and your family.

          1. I understand friend : ) I’ll check back every now and again. If you want to fix it up awesome but you’re very busy I imagine and If you don’t have the time, no worries. It’ll be a good learning lesson. I wish you the best in all your endeavors. Thank you for your time.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.