# Adventure 8: banana.py
#
# From the book: "Adventures in Minecraft", 2nd Edition
# written by <NAME> and <NAME>, Wiley, 2017
# http://eu.wiley.com/WileyCDA/WileyTitle/productCd-1119439582.html
#
# This program senses when you touch a banana connected to your micro:bit

import microbit
import time

BANANA = microbit.Image("00090:00090:00990:09900:99000")

while True:
    time.sleep(0.25)
    if microbit.pin0.is_touched():
        microbit.display.show(BANANA)
    else:
        microbit.display.show('?')

# END


# Adventure 8: banana.py
#
# From the book: "Adventures in Minecraft", 2nd Edition
# written by <NAME> and <NAME>, Wiley, 2017
# http://eu.wiley.com/WileyCDA/WileyTitle/productCd-1119439582.html
#
# This program senses when you touch a banana connected to your micro:bit

import microbit
import time

BANANA = microbit.Image("00090:00090:00990:09900:99000")

while True:
    time.sleep(0.25)
    if microbit.pin0.is_touched():
        microbit.display.show(BANANA)
    else:
        microbit.display.show('?')

# END


# Adventure 8: banana.py # # From the book: "Adventures in Minecraft", 2nd Edition # written by <NAME> and <NAME>, Wiley, 2017 # http://eu.wiley.com/WileyCDA/WileyTitle/productCd-1119439582.html # # This program senses when you touch a banana connected to your micro:bit # END