DEMAND ROBOT
- Set the direction and speed of demandRobot motor
demandRobot.motorRun(demandRobot.Motors.ML, demandRobot.Dir.CW, 120)
demandRobot.motorRun(demandRobot.Motors.MR, demandRobot.Dir.CCW, 120)
- Read ultrasonic sensor
basic.showNumber(demandRobot.Ultrasonic(PingUnit.Centimeters))
- Stop the demandRobot motor
demandRobot.motorStop(demandRobot.Motors.ML)
- Read line tracking sensor
demandRobot.enablePatrol(demandRobot.PatrolEnable.PatrolOff)
serial.writeNumber(demandRobot.readPatrol(demandRobot.Patrol.PatrolLeft))
- Turn on/off the LEDs
demandRobot.writeLED(demandRobot.LED.LEDLeft, demandRobot.LEDswitch.turnOn)
- Read IR sensor value
basic.showNumber(demandRobot.irButtonCode())
MIT
- for PXT/microbit (The metadata above is needed for package search.)