Skip to content

energy01/pxt-clg-Maqueenplus

Repository files navigation

MaqueenPlus

Maqueen plus is a STEM educational robot for micro:bit. Optimized with better power management and larger capacity power supply, it can be perfectly compatible with Huskylens AI Vision Sensor.

Basic usage

  • Control the motor speed and direction; stop motor rotating
DFRobotMaqueenPlus.I2CInit()
DFRobotMaqueenPlus.mototRun(Motors.ALL, Dir.CW, 255)
DFRobotMaqueenPlus.mototStop(Motors.M1)
  • Read the speed and direction of the left/right motor
DFRobotMaqueenPlus.I2CInit()
basic.forever(function () {
    serial.writeValue("speed", DFRobotMaqueenPlus.readSpeed(Motors1.M1))
    serial.writeValue("direction", DFRobotMaqueenPlus.readDirection(Motors1.M1))
})
  • Read the state and greyscale value of the line-tracking sensor
DFRobotMaqueenPlus.I2CInit()
basic.forever(function () {
    serial.writeValue("patorl", DFRobotMaqueenPlus.readPatrol(Patrol.L1))
    serial.writeValue("voltage", DFRobotMaqueenPlus.readPatrolVoltage(Patrol.L1))
})

  • Read IR value and the distance the ultrasound returns
DFRobotMaqueenPlus.I2CInit()
basic.forever(function () {
    serial.writeValue("IR", DFRobotMaqueenPlus.IR_read())
    serial.writeValue("ultrasonic", DFRobotMaqueenPlus.ultraSonic(PIN.P0, PIN.P0))
})

  • Servo control module for controlling 3-way servo
DFRobotMaqueenPlus.I2CInit()
DFRobotMaqueenPlus.servoRun(Servos.S1, 100)

  • RGB LED control module: let Maqueen Plus's RGB LEDs display various colors
DFRobotMaqueenPlus.I2CInit()
DFRobotMaqueenPlus.setRGBLight(RGBLight.RGBL, Color.RED)

License

MIT

Copyright (c) 2018, microbit/micropython Chinese community

Supported targets

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

About

MakeCode Maqueenplus

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages