Refactor calibration constants and update travel snippet documentation
This commit is contained in:
Vendored
+2
-2
@@ -65,8 +65,8 @@
|
||||
},
|
||||
"DCMotorTravelDistance": {
|
||||
"prefix": "MoveCm",
|
||||
"body": "// Distance = ${1:30}cm, Speed = ${2:speedVar}\nboard.Move(${3:FORWARD}, ${4:POWER}, (#${1:30}*${2:speedVar}), ${5:COAST});",
|
||||
"description": "Moves DC motor for a distance in cm (using #cm*Variable syntax)"
|
||||
"body": "// Distance = ${1:30}cm, Speed = ${2:speedVar} (ms/cm)\nboard.Move(${3:FORWARD}, ${4:POWER}, (#${1:30}*${2:speedVar}), ${5:COAST});",
|
||||
"description": "Moves DC motor for a distance in cm (using #cm*Variable syntax, ensure speedVar is ms/cm)"
|
||||
},
|
||||
"SetDCMotorCalibration": {
|
||||
"prefix": "SetDCMotorCalibration",
|
||||
|
||||
+5
-1
@@ -1,11 +1,15 @@
|
||||
#include <Studuino.h>
|
||||
#include <Clock.h> // Keep the complete smoke-test dependency set in clangd's database.
|
||||
|
||||
// DC Motor Calibration (0-100)
|
||||
#define M1_CALIB 100
|
||||
#define M2_CALIB 100
|
||||
|
||||
Studuino board;
|
||||
|
||||
void setup() {
|
||||
board.InitSensorPort(PORT_A0, PIDLED);
|
||||
byte calib[] = { 100, 100 };
|
||||
byte calib[] = { M1_CALIB, M2_CALIB };
|
||||
board.SetDCMotorCalibration(calib);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user