This is an old revision of the document!
comprehensive report material programming
car part
input.onButtonPressed(Button.A, function () {
wuKong.setMotorSpeed(wuKong.MotorList.M1, -100) wuKong.setMotorSpeed(wuKong.MotorList.M2, 100) T = 1
}) input.onButtonPressed(Button.AB, function () {
if (T == 1) {
wuKong.setMotorSpeed(wuKong.MotorList.M1, 100)
wuKong.setMotorSpeed(wuKong.MotorList.M2, 100)
T = 0
} else {
wuKong.stopMotor(wuKong.MotorList.M1)
wuKong.stopMotor(wuKong.MotorList.M2)
T = 1
}
}) input.onButtonPressed(Button.B, function () {
wuKong.setMotorSpeed(wuKong.MotorList.M1, 100) wuKong.setMotorSpeed(wuKong.MotorList.M2, -100) T = 1
}) let T = 0 T = 1
pen part
basic.forever(function () {
if (input.buttonIsPressed(Button.A)) {
wuKong.setServoSpeed(wuKong.ServoList.S0, 20)
} else {
wuKong.setServoSpeed(wuKong.ServoList.S0, -100)
}
})
wheel part
https://makecode.microbit.org/75006-20679-19973-89492
*This is a code written by someone else. This is not the final version, but it shows that omniscience can be use in micro bit.