Sensors

Read (R) and Write (W) values that come from the robot's sensors. For example, "if accelerometer z-axis > 3G, then set LED's to green."


Read (R) and Write (W)


Read and Write Sensors can be read to evaluate in conditions, but also written as an outcome of a condition. Notice the RW sensors each have a corresponding W only block in the Actions category: Set Heading, Set Speed and Set Color. The Action blocks make it easy for a beginner to write a program quickly by just setting values for each sensor. While the Oval code for the Action-type and Sensor-type is the same, the Sensor-based versions enable embedding the values so they can be read and used in more complex conditions.

Heading

// type: float // access: read & write // range: 0 - 360 // units: degrees heading controlSystemTargetYaw is the directional angle of the robot. Assuming you aim the robot with the blue tail light facing you, then 0° heading is forward, 90° is right, 270° is left, and 180° is back.


Speed

speed // type: float // access: read & write // range: 0 - 255 // units: none

controlSystemTargetSpeed is how fast the robot rolls, on a scale from 0 to 255.


Color

// type: float // access: read & write // range: 0 - 255 // units: none

Individual color channels of the main LED lights, from 0 - 255:

colorRed redLed is the red channel, from 0 - 255.

colorGreen greenLed is the green channel, from 0 - 255.

colorBlue blueLed is the blue channel, from 0 - 255.


Read (R) Only


Read Only Sensors can only be "read" to evaluate in conditions; they can't write. Take a simple thermometer for example; you can't "set" a thermometer, you can only read the temperature value.

Gyroscope

// type: float // access: read // range: -2,000 - 2,000 // units: degrees per second

The spin rate of rotation around a given axis, from -2,000° to 2,000° per second.

orientPitch
gyroSensorPitch is the rate of forward or backward spin, from -2,000° to 2,000° per second.

orientRoll
gyroSensorRoll is the rate of left or right spin, from -2,000° to 2,000° per second.

orientYaw
gyroSensorYaw is the rate of sideways spin, from -2,000° to 2,000° per second.


Orientation

// type: float // access: read // range: -180 - 180 // units: degrees

The tilt angle along a given axis measured by the Gyroscope.

gyroPitch
imuPitchAngle is the forward or backward tilt angle, from -180° to 180°.

gyroRoll
imuRollAngle is left or right tilt angle, from -90° to 90°.

gyroYaw
imuYawAngle is the spin angle, from -180° to 180°.


Accelerometer

// type: float // access: read // range: -8 - 14 // units: G's

Motion acceleration along a given axis.

accelX
accelSensorXRight is the left-to-right acceleration, on a scale of -8 to 8 G's.

accelY
accelSensorYForward is the forward-to-back acceleration, on a scale of -8 to 8 G's.

accelZ
accelSensorZUp is the up-and-down acceleration, on a scale of -8 to 8 G's.

accelC
(((accelSensorXRight^2)+(accelSensorYForward^2)+(accelSensorZUp^2))^0.5) is the combined vector acceleration of all 3 axes, on a scale of 0 to 14 G's.


Vertical Acceleration

verticalAccel
// type: float // access: read // range: -8 - 8 // units: G's

verticalAcceleration is the up-and-down acceleration regardless of the robot's orientation, on a scale of -8 to 8 G's.


Velocity

// type: float // access: read // range: any // units: meters per second

Estimated velocity along a given axis measured by the encoders, in meters per second.

velocityX
locatorVelocityX is the left (-) or right (+) speed, in meters per second.

velocityY
locatorVelocityY is the forward (+) or back (-) speed, in meters per second.

velocityC
(((locatorVelocityX^2)+(locatorvelocityY^2))^0.5) is the combined vector speed of both axes which will always be a positive value, in meters per second.


Location

// type: float // access: read // range: any // units: meters

Estimated location from the origin of a program measured by the encoders, in meters.

locX
locatorPositionX is the left or right location in context to the origin, in meters.


locY
locatorPositionY is the forward or back location in context to the origin, in meters.


Temperature

temperature // type: float // access: read // range: any // units: degrees celsius

getTemperature is the temperature inside the robot in °Celsius (C), which can be significantly different than your room temperature because the robot heats up while driving and charging, and can take a while to cool down.