-
Notifications
You must be signed in to change notification settings - Fork 2
/
show.py
40 lines (31 loc) · 956 Bytes
/
show.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
##
#
# lightning-bike : An e-bike whose electrical support can be booked for a certain period of time and paid with lightning.
#
# @filename : show.py
# @brief : create the qr code from the invoice and show it on the Display
# @author : Matthias Steinig
#
# Folders
# img : basic Images to display
# testing : some testing stuff of course
# tmp : where the composed pictures are
#
# lbike.py main program started from /etc/rc.local
##
import epd2in7
import Image
import subprocess
import os
# CONFIG
basedir = os.path.dirname(os.path.realpath(__file__))
def callSubprocess(cmd):
subprocess.call(cmd.split())
def main():
epd = epd2in7.EPD()
epd.init()
callSubprocess('python '+basedir+'/qr-invoice.py')
# display QR code
epd.display_frame(epd.get_frame_buffer(Image.open(''+basedir+'/tmp/qr_176x264.bmp')))
if __name__ == '__main__':
main()