Animating The Sense Hat - Raspberry Pi Forums


i sort of grew zx81 , commodore 16 basic, although never @ it.
i'm playing around sense hat, i'm rather enjoying, programming has moved on touch since young.
i'm trying sense hat animate 2 space invader images , go first image in program once has displayed last.
in basic command have been goto , line number of image. python more date basic , doesn't recognise it.
know python equivalent goto command?

code: select all

# space invaders  sense_hat import sensehat import time sense = sensehat()  x = (255,0,0) o = (255,255,255)  image_1 = [     o,o,x,x,x,x,o,o,     o,o,x,x,x,x,o,o,     o,o,x,x,x,x,o,o,     o,o,x,x,x,x,o,o,     o,x,x,x,x,x,x,o,     x,o,o,o,o,o,o,x,     x,o,o,o,o,o,o,x,     x,x,o,o,o,o,x,x,     ]  image_2 = [     o,o,x,x,x,x,o,o,     o,o,x,x,x,x,o,o,     o,o,x,x,x,x,o,o,     o,o,x,x,x,x,o,o,     o,x,x,x,x,x,x,o,     o,x,o,o,o,o,x,o,     o,x,o,o,o,o,x,o,     o,x,x,o,o,x,x,o,     ]  sense.set_pixels(image_1) time.sleep(1) sense.set_pixels(image_2) time.sleep(1) goto 10 

use while loop.

infinite loop:
basic

code: select all

10 things 20 goto 10
python

code: select all

while true :      things


raspberrypi



Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support