Ringo Sensors

Ringo Sensors

Methods


edge_lights_off()

Code Equivalent:
EdgeLightsOff();

edge_lights_on()

Code Equivalent:
EdgeLightsOn();

is_over_edge()


Runs several tests to check if the Ringo bot is over an edge, and returns true or false. Does not update edge light sensor variables.

Check out the third party documentation for a more in depth explanation.

Code Equivalent:
IsOverEdge()

look_at_edge()


Looks at each edge sensor with the light off and then on. Updates all edge sensor variables with current data.

Gets called by look_for_edge().

Check out the third party documentation for a more in depth explanation.

Code Equivalent:
LookAtEdge();

look_for_edge()


Calls LookAtEdge() to automatically look for edges on all 3 sensors. Also updates the values of the LeftEdgeSensor, RightEdgeSensor, RearEdgeSensor, LeftEdgeSensorAverage, RightEdgeSensorAverage, RearEdgeSensorAverage.

Returns zero if no edge was seen, or a binary result to represent which edge was detected.

Check out the third party documentation for a more in depth explanation.

Code Equivalent:
LookForEdge()

read_edge_light_sensors(average)


Updates the values of the LeftEdgeSensor, RightEdgeSensor, RearEdgeSensor, LeftEdgeSensorAverage, RightEdgeSensorAverage, RearEdgeSensorAverage. Takes the reading the given number of times.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
average Number

the number of times to run the calculation

Code Equivalent:
ReadEdgeLightSensors(average);

read_left_light_sensor()

Code Equivalent:
ReadLeftLightSensor()

read_right_light_sensor()

Code Equivalent:
ReadRightLightSensor()

read_side_sensors()


Reads the current light levels of the side sensors and sets the appropriate key variables: LeftLightLevelPrev, RearLightLevelPrev, RightLightLevelPrev, LeftLightLevel, RearLightLevel, RightLightLevel, LeftLightLevelAverage, RightLightLevelAverage, RearLightLevelAverage.

Check out the third party documentation for a more in depth explanation.

Code Equivalent:
ReadSideSensors();

reset_look_at_edge()


Zeroes the LookAtEdge() running average based on the current light data.

Check out the third party documentation for a more in depth explanation.

Code Equivalent:
ResetLookAtEdge();

switch_ambient_to_edge()

Code Equivalent:
SwitchAmbientToEdge();

switch_ambient_to_edge()

Code Equivalent:
SwitchAmbientToEdge();