Exemple #1
0
		circle_count += 1
		total_count += 1
		if time.localtime().tm_sec !=last_sec:
			last_sec = time.localtime().tm_sec
			print('Drawn ' + str(circle_count))
			result.append(circle_count)
			circle_count = 0

# First result is unreliable
result.pop(0)
print('Average rate: ' + str(reduce(lambda x, y: x + y, result) / len(result)))

print('--------------------------------------')


tft.flush = True

print('Testing circle draw rate, flush enabled')
result = []
circle_count = 0
last_sec = time.localtime().tm_sec
total_count = 0
while len(result) < 10:
	for color in colors:
		tft.fg_color(color)
		tft.draw_circle(SerialTFT.Screen.width_half+randint(-50,50),SerialTFT.Screen.height_half+randint(-40,40),randint(1,40))
		circle_count += 1
		total_count += 1
		if time.localtime().tm_sec !=last_sec:
			last_sec = time.localtime().tm_sec
			print('Drawn ' + str(circle_count))