![]() It also instantiates the epd object from the ePaper library. The main function instantiates a Display class with the width and height of the ePaper display. The Display class creates a Clock instance to keep track of all this. The other Class is the Clock class - it encapsulates all the stuff needed to keep track of all the words of the Word Clock, including which words to highlight and which words to show un-highlighted (aka in "gray"). This class utilizes the Image, ImageDraw libraries from PIL to render the buffer for the ePaper display to show. ![]() There are two distinct classes - one to encapsulate the Display related stuff (how to draw stuff on the display). I've tried to be object-oriented about the code. It utilizes the PIL Image library to get the image buffer to show on the display. The Waveshare ePaper Display library is installed under the sub-directory "lib" (so it is packaged along with the word clock code and you don't need to install it separately). ![]() I'm a firm believer in the adage "Teach a man to fish and you feed him for life"! Therefore, I'll also delve into the code and try to explain it. Here is the clock in action (speeded up a bit): If all the steps above have been done correctly you should see the Word Clock on your ePaper Display! It has a granularity of 5 minutes or more, so it updates every 5 minutes to show the new time. Run the word_clock_paper.py python script $ python3 word_clock_paper.py Install spidev, RPi.gpio and Pillow dependencies as follows: $ sudo apt-get install python3-spidev $ sudo apt-get install rpi.gpio $ sudo apt-get install python3-pilĬd to the directory that was created with you cloned the git repository above. The code also depends on other libraries. The code expects Python 3+ - if you are using an older version of python, you will need to install python3 If SPI has been properly enabled, the /boot/config.txt entry should show up as above AND you should also see the device connected when you list the SPI devices. Should show something! (like /dev/spidev0.0 /dev/spidev0.1 above) If it doesn’t, try sudo rpi-update and reboot. Search for an entry like the following: dtparam=spi=onĪnd check that you can see the SPI device connected: $ ls /dev/spi* /dev/spidev0.0 /dev/spidev0.1 Some people have encountered issues where the SPI interface doesn't get enabled properly.ĭouble check that SPI is actually "on" in your /boot/config.txt. Step 2 - Double-check that the SPI interface is working This installs the demo code as well as the requisite Waveshare ePaper library. Install the ProtoStax Work Clock Demo code from the GitHub Repository (link below) $ git clone
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |