From 6b157eace004fd62d2a80beccdd54ba87fe72871 Mon Sep 17 00:00:00 2001 From: jmzjmzjmz Date: Wed, 7 Jun 2017 17:25:27 -0400 Subject: [PATCH] added cat image to demo :) --- examples/buttons.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/buttons.py b/examples/buttons.py index fbc6716..88e9e05 100644 --- a/examples/buttons.py +++ b/examples/buttons.py @@ -150,9 +150,14 @@ try: else: # button is pressed: draw.ellipse((100,20,120,40), outline=255, fill=1) #B button filled - # Display image. - disp.image(image) - disp.display() + if not GPIO.input(A_pin) and not GPIO.input(B_pin) and not GPIO.input(C_pin): + catImage = Image.open('happycat_oled_64.ppm').convert('1') + disp.image(catImage) + else: + # Display image. + disp.image(image) + + disp.display() time.sleep(.01)