fll-pigeons / gamechangers

Pigeons First Lego League Team
https://fll-pigeons.github.io/gamechangers/
2 stars 1 forks source link

Micropython Gyro calibration #15

Open kendmaclean opened 3 years ago

kendmaclean commented 3 years ago

From FLL Challenge facebook group: ... We run the function below before the start of each run out of base. We ensure a 1/2 second delay from hitting the 'go' button to ensure the robot isn't being touched. ( We aren't geniuses, we googled this issue and came up with the below and tweaked it)

def calibrategs(self):
    debug_print('GS Calibration begin')
    time.sleep(.5)
    for _ in range(2):
        self.gyro.mode = 'GYRO-RATE'
        self.gyro.mode = 'GYRO-ANG'
        time.sleep(.5)
    gsnow = self.gyro.angle
    debug_print('GS Calibration finish ' + str(gsnow))
kendmaclean commented 3 years ago

This looks more like EV3DEV python than official Lego Micropython...