Exemple #1
0
	def __init__(self):
		rpi = 'tft'
		if rpi == 'tft':
			import tft
			self.myUoled = tft.Screen()
		elif rpi == 'uoled':
			import uoled
			self.myUoled = uoled.uoled()	
		else:		# linux console
			import uoled_emulator
			self.myUoled = uoled_emulator.Uoled_Emulator()
		x = 0
		y = 0
		self.maxx = 128
		self.maxy = 32
		self.minx = 0
		self.miny = 0
		self.movx = 1
		self.movy = 1

		self.obs = [[[20,20],[20,21],[21,20],[21,21],[22,20],[22,21]], 
				[[80,28],[80,29],[80,30],[80,31]],
				[[60,5],[60,6],[60,7],[60,8]]]
#		self.myUoled.draw_sprite(self.obs)
		self.main_loop(x,y)
Exemple #2
0
	def __init__(self):
		RPi = False
		if RPi == True:
			import uoled
			self.myUoled = uoled.uoled()	
		else:
			import uoled_emulator
			self.myUoled = uoled_emulator.Uoled_Emulator()
		x = 0
		y = 0
		self.maxx = 128
		self.maxy = 32
		self.minx = 0
		self.miny = 0
		self.movx = 1
		self.movy = 1

		self.obs = [[[20,20],[20,21],[21,20],[21,21],[22,20],[22,21]], 
				[[80,28],[80,29],[80,30],[80,31]],
				[[60,5],[60,6],[60,7],[60,8]]]
		self.myUoled.draw_sprite(self.obs)
		self.main_loop(x,y)
Exemple #3
0
#!/usr/bin/python
# bounce.py
# Very simple implementation of bouncing ball.

import time

RPi = True
if RPi == True:
	import uoled
	MyUoled = uoled.uoled()	
else:
	import uoled_emulator
	MyUoled = uoled_emulator.Uoled_Emulator()

print 'Starting bounce...'

x = 0
y = 0
maxx = 128
maxy = 32
minx = 0
miny = 0
movx = 1
movy = 1

while True:
	MyUoled.delete_blob(x,y)
	x += movx
	y += movy
	if x >= maxx:
		movx = -1