#!/usr/bin/env pybricks-micropython from pybricks.hubs import EV3Brick from pybricks.ev3devices import (Motor, TouchSensor, ColorSensor, InfraredSensor, UltrasonicSensor, GyroSensor) from pybricks.parameters import Port, Stop, Direction, Button, Color from pybricks.tools import wait, StopWatch, DataLog from pybricks.robotics import DriveBase from pybricks.media.ev3dev import SoundFile, Image, ImageFile # This program requires LEGO EV3 MicroPython v2.0 or higher. # Click "Open user guide" on the EV3 extension tab for more information. # Create your objects here. ev3 = EV3Brick() # Initialize the motors. left_motor = Motor(Port.B) right_motor = Motor(Port.C) # Initialize the drive base. #robot = DriveBase(left_motor, right_motor, wheel_diameter=56, axle_track=114) robot = DriveBase(left_motor, right_motor, wheel_diameter=41, axle_track=114) ev3.screen.load_image(Image(ImageFile.NEUTRAL)) # Go forward and backwards for 1/2 meter. robot.straight(500) ev3.speaker.beep() robot.straight(-500) ev3.speaker.beep() # Turn clockwise by 360 degrees and back again. robot.turn(360) ev3.speaker.beep() robot.turn(-360) ev3.speaker.say("hello campers")