Upload files to "hazmat_scrimmage"

This commit is contained in:
2026-10-20 23:13:34 +00:00
parent 29a16afbf8
commit c6c117daf7
5 changed files with 250 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
####################################################
# bioglow_robot_settings.py
# This file contains all the common robot settings
# Only change this when necessary
#####################################################
#Important Notice: All codes should be tested while the robot's battery is at 100%, and all updates must be made when the robot is at full charge.
from pybricks.pupdevices import Motor, ColorSensor, UltrasonicSensor, ForceSensor
from pybricks.parameters import Button, Color, Direction, Port, Side, Stop
from pybricks.tools import run_task, multitask
from pybricks.tools import wait, StopWatch
from pybricks.robotics import DriveBase
from pybricks.hubs import PrimeHub
import umath
# Initialize hub and devices
hub = PrimeHub()
left_motor = Motor(Port.A, Direction.COUNTERCLOCKWISE)
right_motor = Motor(Port.B,Direction.CLOCKWISE) # Specify default direction
left_arm = Motor(Port.C, Direction.CLOCKWISE, [[12,36],[12,20,24]]) # FIXED: both gear trains in ONE list
right_arm = Motor(Port.D, Direction.CLOCKWISE,[[12,36],[12,20,24]]) #Added gear train list for gear ration
lazer_ranger = UltrasonicSensor(Port.E)
color_sensor = ColorSensor(Port.F)
# DriveBase configuration
WHEEL_DIAMETER = 62.4 # mm (adjust for your wheels)
AXLE_TRACK = 150 # mm (distance between wheels)
# The ONE drive base. Every other file imports it from here — never make another.
drive_base = DriveBase(left_motor, right_motor, WHEEL_DIAMETER, AXLE_TRACK)
drive_base.settings(600, 500, 300, 200)
drive_base.use_gyro(True)