Approved content

The content below is provided by a partner.

tinkertanker/pxt-continuous-servo 0.0.6 GitHub

Continuous Servo Package for Micro:bit on MakeCode

For use with continuous servos.

User Guide

Make a Micro:bit Car with continuous servos

Code Example

basic.forever(() => {
    // one motor at a time
    ContinuousServo.turn_off_motor(AnalogPin.A2)
    ContinuousServo.spin_one_way(AnalogPin.A1)
    basic.pause(500)
    // switch over
    ContinuousServo.turn_off_motor(AnalogPin.A1)
    ContinuousServo.spin_other_way(AnalogPin.A2) // because they're inverted
    basic.pause(500)
})

License

MIT

Supported targets

for PXT/microbit (The metadata above is needed for package search.)

ContinuousServo=github:tinkertanker/pxt-continuous-servo#v0.0.6