Session Details
Week 2,
Session 6 — Fri Dec 10
Prep
-
Zelle, §3.4–3.6
HW Due
-
HW 5
But accepted without penalty until Monday at 5 p.m. (as usual for homework assigned on Thursday)
Topics
-
Practice: Loops — Counted loops and Accumulator loops
-
Practice: Objects — Constructing, applying methods, referencing instance variables (aka fields)
-
Practice: Robots — Constructing, applying methods, using in functions
-
Robots: getting sensor input
Outline
-
[5 min] Angel for attendance. Questions?
-
[10 min] The Image object in Zellegraphics:
- Constructing
- Drawing and moving
Module: m2_image_example.py
-
[20 min] Review: Robots using PyCreate:
- Constructing a Create object (i.e., robot) connected to a port
- Shutting down a robot
- Moving a robot — straight, spinning or both at the same time — using the PyCreate go and stop methods, with a time.sleep function call in between
Module: m1_robot_example.py
-
[10 min] Getting sensor input in PyCreate: the PyCreate getSensor method
- Cliff sensor readings
- Angle and Distance sensor readings
- Other sensor readings
Module: m1_robot_example.py
-
[5 min] Break
-
[10 min] Practice: integrating what we have learned so far
- Loops, especially accumulator loops
- Using objects: constructing and applying methods
- Robotics: actuators and sensors
Module: m3_distance_traveled.py
Resources
-
No slides today
HW Assigned
-
HW 6