This is some code for the e-ink badges for the open day that can be adapted to suit.
The badges have three modes, as follows -
- mode a (button A) - this mode cycles through 3 types of display at random -
- BOFH - quotes from the BOFH series stored in
texts/bofh-excuses.txt
- images - files in the
images
directory - epigrams - witty(for a given value of witty) sayings stored in
texts/epigrams.txt
- BOFH - quotes from the BOFH series stored in
- mode b (button B) - this mode just displays the persons name, role and School alongside a QR code or the Coventry Pheonix
- mode c (button C) - this mode displays either the same as the QR version of mode b, or the persons name plus a message which comes from
texts/mess.txt
For modes a and c, the image will change after a certain number of seconds (defined by speed * SPEED_MULTIPLIER
)
The up and down buttons will either toggle between the QR code and the Pheonix (mode b) or change the value of speed
and hence how quickly the badge displays something new (modes a and c)
- Follow the instructions on the pimoroni badger page to get the environment set up.
- Copy these files to the badge-
badgie.py
battery.pi
boot.py
main.py
simplybadge.py
pheonix.bin
qr.bin
person.txt
- Create the following directories on the top level of the badge -
images
texts
- Copy the files in the
images
directory on the computer to theimages
directory on the badge - Copy the files in the
texts
directory on the computer to thetexts
directory on the badge - Run main.py to test to make sure everything is working.
The main things that you'll want to configure is your name, etc. and this is stored in the file person.txt
. This file is four lines long, with the following structure, each on it's own line -
- Your name
- First line of the School name
- Second line of the School name
- Your role
You'll probably also want to create your own QR code. Whilest you can put a VCARD in a QR code, the chances of it displaying properly on the badge are remote. The best thing to do is to link the QR code to an online VCARD or a website with your contact details (e.g. your Pure profile) and code the URL of that site into the QR code. To do this -
-
edit the file
vCard-QR.py
and generate the QR code (this should be done on the PC, not on the badge) -
Open the file generated (
qr.png
) in your favourite image editor (e.g. Gimp) and- reduce the image to 1 bit
- scale the image to 104x104
- enlarge the canvas (NOT the image) to 104x128 and centre the image on the canvas
- save that image
-
Run the
convert.py
programme (on your PC) with the image -convert.py --binary qr.png
-
Upload the resultant file,
qr.bin
to the top level of the badge (do NOT load it into theimages
directory)
battery.py
- gives the current state of the batteryconway.py
- Conway's game of life from the Badger demossimplebadge.py
- a static badge which is the QR version of mode b. This saves the battery going down, so it's a good "sleep" type mode.