Add calibration, servomotor, and distance travel snippets/setup

This commit is contained in:
alvinlollo
2026-10-09 14:47:38 +11:00
parent 6e49b7565b
commit 1c241952fb
2 changed files with 18 additions and 0 deletions
+16
View File
@@ -57,5 +57,21 @@
"prefix": "board.Buzzer",
"body": "board.Buzzer(${1:pitch}, ${2:duration});",
"description": "Plays a sound on the buzzer."
},
"Servomotor": {
"prefix": "board.Servomotor",
"body": "board.Servomotor(${1:PORT}, ${2:ANGLE});",
"description": "Sets the servomotor angle."
},
"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)"
},
"SetDCMotorCalibration": {
"prefix": "SetDCMotorCalibration",
"body": "byte calib[] = { ${1:100}, ${2:100} };\nboard.SetDCMotorCalibration(calib);",
"description": "Sets DC Motor speed calibration."
}
}