Learn 2: Build and Calibrate
This is the fifth challenge within the Robotics with GoPiGo and Python Curriculum.
Your task is to design a robot program to deliver a selection of mail to the residents of GoPiGo Drive, a small cul-de-sac containing 3 houses.
Learn how to how to use and calibrate the color sensor.
4. Instantiating
We are now ready to create instances of the line follower and color sensor classes and give them the names line_follower and color_sensor for ease of reference later on.
# initialize the light & color sensor (attached to an I2C port)
color_sensor = courier.init_light_color_sensor(led_state = True)
# initialize the line following sensor (attached to an I2C port)
line_follower = courier.init_line_follower()
Type the above code into the Sensor Setup Code cell in the template notebook and select Run Selected Cell to set up your sensor.
- Run this cell right away.