Esempio n. 1
0
	relx = 0
	rely = 0

	print "scanning grid ",width,"x",height
	print >>outf, "P2"	# PGM with ascii values
	print >>outf, width, height
	print >>outf, 1024

	for j in xrange(height):
		# scan line
		print "LINE",j
		for i in xrange(width):
			# record
			time.sleep(0.1)
			val = bot.get_analog_input()
			#print val,calib(val), '@',relx, rely
			print calib(val),
			print >>outf, calib(val),
			# move		
			bot.move(stepby,0)
			relx += stepby
		print >>outf
		print

		# retrace
		for i in xrange(width):
			bot.move(-stepby,0)
			relx -= stepby

		# move down
Esempio n. 2
0
#! /usr/bin/python

from bot import Bot
import time

if __name__ == "__main__":
	b = Bot()
	print b.get_version()
	b.enable_analog_input()
	while True:
		print b.get_analog_input()
		time.sleep(.1)