Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- import Adafruit_SSD1306
- from PIL import Image,ImageDraw,ImageFont
- disp = Adafruit_SSD1306.SSD1306_128_64(rst=1)
- disp.begin()
- disp.clear()
- count=0
- font = ImageFont.truetype('VCR_OSD_MONO_1.001.ttf',22)
- def show(x,y,st1,st2,st3):
- image = Image.new('1',(128,64))
- draw = ImageDraw.Draw(image)
- draw.text((x,y),str(st1),font=font, fill=1)
- draw.text((x,y+20),str(st2),font=font, fill=1)
- draw.text((x,y+40),str(st3),font=font, fill=1)
- disp.image(image)
- disp.display()
- while(1):
- count=count+1
- show(0,0,"KRITSADA","JAIYEN",str(count))
- time.sleep(0.5)
Advertisement
Add Comment
Please, Sign In to add comment