Skip to content

YFROBOT-TM/pxt-demand-robot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demand Robot

DEMAND ROBOT

Basic usage

  • 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())

License

MIT

Supported targets

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published