t108a.py

00001 # Anything that starts with a # is a comment!
00002 # Use lots of comments in your code to explain what you're doing.
00003 
00004 # Use the PIC-specific Python libraries
00005 import t108b as pic
00006 
00007 
00008 ###############################################################
00009 # Set up line sensors, distance sensor, motors 
00010 ###############################################################
00011 
00012 line_sensor_right =  pic.digital_io(1,   8,  True)
00013 right_wheel_stopped  = 938
00014 
00015 def drive_forward():
00016     right_wheel.setCounts(right_wheel_forward)
00017     
00018 def stop_driving():
00019     right_wheel.setCounts(right_wheel_stopped)
00020 
00021 
00022 ###############################################################
00023 # Main loop
00024 ###############################################################
00025 
00026 print "Running..."
00027 i = 0;
00028 while i < 10000:
00029     i = i + 1
00030     # Print out line following diags
00031     if line_sensor_right.get():
00032         pass

Generated on Mon Oct 18 07:40:47 2010 for Python-on-a-chip by  doxygen 1.5.9