Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sense_hat import SenseHat
- from time import sleep
- sense = SenseHat()
- sense.set_rotation(270)
- sense.show_message("My name should be Colin", scroll_speed = 0.01)
- yellow = (255,255,0)
- green =(0,255,0)
- red = (255,0,0)
- o=(255,130,0)
- b=(0,0,255)
- c=(0,150,255)
- e=(80,80,80)
- g=(0,255,0)
- y=(255,255,0)
- sense.show_message("Colin", scroll_speed = 0.05, text_colour=yellow, back_colour = red )
- sleep(1)
- wet = [
- b, b, b, b, b, b, b, b,
- b, b, b, b, b, b, b, b,
- b, o, b, o, o, o, b, b,
- b, o, o, o, o, e, o, b,
- b, o, o, o, o, o, o, b,
- b, o, b, o, o, o, b, b,
- b, b, b, b, b, b, b, b,
- b, b, b, b, b, b, b, b
- ]
- sense.set_pixels(wet)
- dry = [
- c, c, g, g, c, c, c, c,
- c, c, g, g, c, g, c, c,
- g, c, g, g, c, g, c, c,
- g, c, g, g, c, g, c, c,
- g, g, g, g, g, g, c, c,
- c, c, g, g, c, c, c, c,
- y, y, y, y, y, y, y, y,
- y, y, y, y, y, y, y, y
- ]
- humid = round(sense.get_humidity(),1)
- sleep(1)
- sense.show_message("The humidity is " + str(humid) + " %")
- if humid >= 40:
- sense.set_pixels(wet)
- else:
- sense.set_pixels(dry)
Add Comment
Please, Sign In to add comment