Approved content
The content below is provided by a partner.
The product page for the Apprentice Car can be found at https://resoluteshop.co.za/product/apprentice-car/
kBit.run(KBitDir.RunForward, 50)
basic.pause(500)
kBit.run(KBitDir.RunBackward, 50)
basic.pause(500)
kBit.run(KBitDir.TurnRight, 50)
basic.pause(500)
kBit.run(KBitDir.TurnLeft, 50)
basic.pause(500)
kBit.carStop()
kBit.motor(KBitMotorObs.LeftSide, KBitMotorDir.Forward, 50)
kBit.motor(KBitMotorObs.RightSide, KBitMotorDir.Forward, 50)
irRemote.connectInfrared(DigitalPin.P0)
basic.forever(function () {
if (irRemote.returnIrButton() == irRemote.irButton(KBitIrButtons.Ok)) {
basic.showString("OK")
basic.pause(100)
basic.clearScreen()
}
})
let strip = neopixel.create(DigitalPin.P5, 18, NeoPixelMode.RGB)
basic.forever(function () {
strip.showColor(neopixel.colors(NeoPixelColors.Yellow))
})
Ultrasonic sensor.
The Ultrasonic block will return the distance it measures in cm, and this can be compared as follows:
if (kBit.ultra() > 5) {
basic.showIcon(IconNames.Angry)
} else {
basic.showIcon(IconNames.Happy)
}
LED blocks.
In order to change the color of the two LED’s at the front of the apprentice robot,
it is required you set the LED brightness and then the color, as shown below:
kBit.ledBrightness(100)
kBit.led(KBitColor.Red)
MIT
More info can be found here
apprentice_car=github:resolute-support/pxt-apprentice_Car
apprentice_car=github:resolute-support/pxt-apprentice_Car#v1.1.7