Skip to content

Commit

Permalink
Set motors and servo state to zero initially
Browse files Browse the repository at this point in the history
  • Loading branch information
noqman committed Nov 18, 2024
1 parent 15182c0 commit 99fb86d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ const REG_ADD_RESET = 36;
//% groups=['DC Motors', 'Servos' , 'Mode', 'Motor Current','Opponent Sensors' , 'Edge Sensors', 'RGB LED', 'Robot Kit']
namespace sumobit {

// Stop all motor.
stopMotor(SumobitMotorChannel.RightMotor);
stopMotor(SumobitMotorChannel.LeftMotor);
// Stop all motor initially
sumobit.i2cWrite(REG_ADD_PWM1, 0);
sumobit.i2cWrite(REG_ADD_PWM2, 0);

// Disable the servos.
disableServo(ServoChannel.Servo1);
disableServo(ServoChannel.Servo2);
// Disable the servos initially
sumobit.i2cWrite(ServoChannel.Servo1, 0);
sumobit.i2cWrite(ServoChannel.Servo2, 0);


/**
Expand Down

0 comments on commit 99fb86d

Please sign in to comment.