Venture of Robots

VEX机器人角度传感器使用编程说明-How to use a potentiometer of VEX Robotics.



Potentiometer is a widely used analog sensors. It can read the degrees of the deflection angle between its centre and the shaft.The maximum degree it can read is 270 degrees.

在RobotC的编程语言中, 角度传感器没有特殊的函数未知对象,可以直接用SensorValue() 函数读取它的值。

In the language of RobotC, potentiometer doesn’t have any speacial fuction of it. We can read its value by using the fuction “SensorValue()”.


Data Range:

0 to 4095. Minimum and maximum values are achieved at opposite ends of travel of the potentiometer and may vary slightly from one potentiometer to another.


Notice: It’s wire should be plugged into the Analog port on the Cortex.

1> Configurate a potentiometer sensor. 配置一个角度传感器

Click “Motor and Sensor Setup”.

点击Motor and Sensor Setup

选择  VEX 2.0 Analog Sensors 1-8.

Choose “VEX 2.0 Analog Sensors 1-8”.

Click ” SensorType “, choose “potentiometer”. Then name the Sensor.Click “Apply”.

点击 ” SensorType “, 选择 “potentiometer”.  接着重命名这个传感器。点击应用。

Then  it’s done!


2> 读取一个传感器的值

Read the value of a Sensor

或者/ or

code is given below:



With the value that we read, we can accomplish many more things. Try it yourself and try more interesing ways of using it.

有了读取到的值后,我们可以用它来实现很多功能。 自己写写试试并探索更多有趣的用法吧!

作者/Author :Alpar.

This post is orginal, please remember to mark the source if you want to transfer the content.



Leave a Reply

Your email address will not be published. Required fields are marked *