Approved content

The content below is provided by a partner.

artec-kk/pxt-artecrobo-kit 0.1.2 GitHub

ArtecRobo

Extension for ArtecRobo

Basic usage

The way to set DC motor power is by using the setSpeedDCMotor blocks. With each of these blocks you specify M1 or M2, and a speed from 0 to 1023.

// Set M1 Dcmotor to max power(1023)
artecrobo.setSpeedDCMotor(connectorDCMotor.M1, 1023)

The way to move DC motor is by using the moveDCMotor blocks. With each of these blocks you specify M1 or M2, and a Forward, Backward, Brake or Coast.

// Control M1 DC motor to Forward
artecrobo.moveDCMotor(connectorDCMotor.M1, DCmotion.Forward)

The way to move Servomotor is by using the moveServoMotorMax blocks. With each of these blocks you specify P13, P14 or P15, and an angle from 0 to 180.

// Set P13 servomotor to 90 degree
artecrobo.moveServoMotorMax(connectorServoMotor.P13, 90)

The way to move Servomotor at a specified speed is by using the moveServoMotor blocks. With each of these blocks you specify P13, P14 or P15, an angle from 0 to 180, a speed from 1 to 20.

// Set P13 servomotor to 90 degree at speed 20
artecrobo.moveServoMotor(connectorServoMotor.P13, 90, 20)

The way to move Servomotors at a specified speed is by using the AsyncMoveServoMotor blocks. With each of these blocks you specify a speed from 0 to 20 and an angle from 0 to 180 with P13, P14, or P15.

// Set P13, P14, and P15 servomotors to 0, 90, 180 degree at speed 20
artecrobo.AsyncMoveServoMotor(20, 0, 90, 180)

License

MIT

Supported targets

ArtecRobo=github:artec-kk/pxt-artecrobo-kit#v0.1.2