Robotics Enrichment Program
Middle School Robotics Majors
Sessions 2, 3 & 4
Search & Rescue Mission
Navigate in a maze with lights blinking and sound blasting without hitting anything until locate a lost object (reach the end). Once located, take a picture.
LED Lights
Camera
- Install the camera on a raspberri pi.
- Try out the program called
TakingPhotos.ipynb
located ongopigo
under “Examples”
Speakers
- Plug in the speaker
- Find a open-source tune
- Try it in the code
import pygame
# Play music
pygame.mixer.init()
pygame.mixer.music.load("music.mp3")
pygame.mixer.music.set_volume(1)
pygame.mixer.music.play()
Distance Sensor
- Plugin the distance sensor
- Try it out in the code
import easygopigo3 as easy
gpg = easy.EasyGoPiGo3()
my_distance_sensor = gpg.init_distance_sensor() # init the distance sensor
steps = 100 # times
t = 0
while t < steps:
dist = my_distance_sensor.read_inches()
if dist > 20:
gpg.drive_inches(5)
else:
gpg.turn_degrees(90)
t = t + 1
Session 1
Getting started with gopigo
:
- Turn on battery and turn on the robot
- Go to mygopigo.com
- Write Python code for robot movement
- Shut down the robot
Middle School Robotics Minors
Exploring gopigo
:
- Turn on battery and turn on the robot
- Go to mygopigo.com
- Drive the robot around using remote control (buttons)
- Go to Code -> Bloxter
- Write block-based code for robot movement
- Write Python code for robot movement
- Shut down the robot