![how to program robotc how to program robotc](https://static.docsity.com/documents_first_pages/2013/03/17/16ae9abf0c3270678a15e80223d3a01a.png)
Values are in percentages and range from -100 (full reverse) to +100 (full forward).VEX Robotics I Power Points Topic 09 Programming Design Basics Bumper Switch Sensing 1.Returns the speed value of the motor plugged into nMotorIndex.Loop until the current encoder counts are equal to the target counts Set the target of motor A to 1000 encoder counts at speed 50 Returns the encoder value of the motor plugged into the port specified by nMotorIndex in degrees.Ĭode Example: //Reset the motor encoder value to zero.Resets the encoder value of the motor plugged into nMotorIndex to 0.Ĭode Example: //Resets the encoder value of motor port A to 0įloat getMotorEncoder ( tMotor nMotorIndex )įunction returns a floating point decimal value.Void resetMotorEncoder ( tMotor nMotorIndex ) RepeatUntil(getMotorEncoder(motorA) = getMotorTarget(motorA)) Set motor A's target of 1000 degrees at speed 50
![how to program robotc how to program robotc](https://www.vexforum.com/uploads/default/original/2X/4/4134817560c84740e3433cf8f6f0104c100c498f.png)
#HOW TO PROGRAM ROBOTC FULL#
A zero value stops the motor.Ĭode Example: //Sets the speed value of motor motor port A to full forward (+100) Values for the motor velocity range from -100 (full reverse) to +100 (full forward).The nMotorIndex command identifies the name or port of the motor.The velocity for the motor, which the nSpeed command is used for, and the port that the motor is plugged into. There are two pieces of information that this command needs.This command will set the speed of the motor.Zero is the value for stopping the motors Port number that the motor is plugged into. Void setMotorSpeed ( tMotor nMotorIndex, int nSpeed ) A count of 180 indicates that the motor has traveled half of a rotation. The encoders have 360 counts per single revolution of the motor. Each motor is equipped with an integrated encoder that can be used to determine the current position of the motor. There are four motor ports on the EV3 labeled A, B, C, and D. Our Function Library (Updated Spring 2013) EV3 - Motor Commands A Non-Functioning EV3 (i.e., frozen or dead).