Robotics Enrichment Program

Middle School Robotics Majors

EasyGoPiGo Documentation

Session 1

Getting started with gopigo:

  1. Turn on battery and turn on the robot
  2. Go to mygopigo.com or 10.10.10.10
  3. Write Bloxter code for robot movement
  4. Shut down the robot

Session 2

  1. Write Python code for robot movement
  2. Write Python code for light manipulation

LED Blinkers Code

LED Eyes Code

Speakers

  1. Plug in the speaker
  2. Find a open-source tune
  3. Try it in the code
import pygame

# Play music
pygame.mixer.init()    
pygame.mixer.music.load("music.mp3")
pygame.mixer.music.play()

Race

Straight line race with music playing and lights blinking.

Session 3

Distance Sensor

  1. Plugin the distance sensor
  2. 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 4

Moisture monitoring

/*
*Simple sketch to demonstrate sending data over Serial to a computer
*Program reads data from the moisture sensor
*/

int soilMoistureValue = 0;

void setup(){
  Serial.begin(9600); // Start up Serial Port
  Serial.println("Simple Logging Sketch - send serial data to CSV");
}

void loop(){
  // Wait for computer to send character
  // Once character received, start sending data to computer
  soilMoistureValue = analogRead(A0);  //put Sensor insert into soil
  Serial.print("Moisture reading: ");
  Serial.println(soilMoistureValue);
  // 2500 gives two outputs per second
  // 25000 give two outputs every 25 seconds
  delay(10000);
}

Session 5

Basics of Robot Electronics with Arduino