Robotics Round-up: Python Computing¶


# Our team's simple test module

from gpiozero import Robot
import time

robby = Robot(left=(7, 8), right=(9, 10))

robby.forward()
time.sleep(20)
robby.stop()

Thinking In Python | Code Comments¶


# Our team's simple test module
a = 1 # this is also a comment
'''
this is also comment
that fits on multiple
lines 

:)

a = 1
'''

Thinking In Python | Machine Instructions¶


# Our team's simple test module
from gpiozero import Robot    # <-- this is a library import statement
import time
robby = Robot(left=(7, 8), right=(9, 10))    # <-- variable = value
robby.forward()  # <-- execute the "forward" command
time.sleep(20)    # <-- Python sleep command stops right here for X seconds
robby.stop()    # <-- execute the "stop" command