Infrared (IR) is invisible light with longer wavelengths than visible light, and it is commonly used in TV remote controls to transmit small amounts of data. IR is used in Sphero BOLT, BOLT+, and RVR/RVR+ to transmit data such as relative distance and heading between robots to enable following and evading behavior among multiple robots, as well as to send custom messages. There are four IR emitters and receivers (pairs) for 360° awareness assuming there is a clear line of sight between two or more robots. The effective range is up to about 3 meters.
Sets the IR emitters to broadcast on two specified channels, from 0 to 7, so other robots can follow or evade. The broadcaster uses two channels because the first channel emits near IR pulses (< 1 meter), and the second channel emits far IR pulses (1 to 3 meters) so the following and evading robots can detect these messages on their IR receivers with a sense of relative proximity to the broadcaster. You can't use a channel for more than one purpose at time, such as sending messages along with broadcasting, following, or evading.
Use the following examples to broadcast on channels 0 and 1, so that other robots following or evading on 0 and 1 will recognize this robot:
JavaScript: startIRBroadcast(0, 1)
Python: start_ir_broadcast(0, 1)
Parameters:
nearChannel {number} - The channel (0 to 7) for near IR pulses (< 1 meter)
farChannel {number} - The channel (0 to 7) for far IR pulses (1 to 3 meters)
Compatible Robots:
BOLT, BOLT+, RVR, RVR+
Stops the IR broadcasting behavior.
Use the following examples to stop broadcasting:
JavaScript: stopIRBroadcast()
Python: stop_ir_broadcast()
Compatible Robots:
BOLT, BOLT+, RVR, RVR+
Sets the IR receivers to look for broadcasting robots on the same channel pair, from 0 to 7. Upon receiving messages from a broadcasting robot, the follower will adjust its heading and speed to follow the broadcaster. When a follower loses sight of a broadcaster, the follower will spin in place to search for the broadcaster. You can't use a channel for more than one purpose at time, such as sending messages along with broadcasting, following, or evading.
Use the following examples to follow another robot that is broadcasting on channels 0 and 1:
JavaScript: startIRFollow(0, 1)
Python: start_ir_follow(0, 1)
Parameters:
nearChannel {number} - The channel (0 to 7) for near IR pulses (< 1 meter)
farChannel {number} - The channel (0 to 7) for far IR pulses (1 to 3 meters)
Compatible Robots:
BOLT, BOLT+, RVR, RVR+
Stops the IR following behavior.
Use the following examples to stop following another robot that is broadcasting:
JavaScript: stopIRFollow()
Python: stop_ir_follow()
Compatible Robots:
BOLT, BOLT+, RVR, RVR+
Sets the IR receivers to look for broadcasting robots on the same channel pair, from 0 to 7. Upon receiving messages from a broadcasting robot, the evader will adjust its heading to roll away from the broadcaster. When an evader loses sight of a broadcaster, the evader will spin in place to search for the broadcaster. The evader may stop if it is in the far range for a period of time so it does not roll too far away from the broadcaster. You can't use a channel for more than one purpose at time, such as sending messages along with broadcasting, following, or evading.
Use the following examples to evade another robot that is broadcasting on channels 0 and 1:
JavaScript: startIREvade(0, 1)
Python: start_ir_evade(0, 1)
Parameters:
nearChannel {number} - The channel (0 to 7) for near IR pulses (< 1 meter)
farChannel {number} - The channel (0 to 7) for far IR pulses (1 to 3 meters)
Compatible Robots:
BOLT, BOLT+, RVR, RVR+
Stops the IR evading behavior.
Use the following examples to stop evading another robot that is broadcasting:
JavaScript: stopIREvade()
Python: stop_ir_evade()
Compatible Robots:
BOLT, BOLT+, RVR, RVR+
Sends a message on a given IR channel, at a set intensity, from 1 to 64. Intensity is proportional to proximity, where a 1 is the closest, and 64 is the farthest. You will need to use the "On IR Message" event for a corresponding robot to receive the message. Also see the "Get Last IR Message" function to keep track of the last message your robot received. You can't use a channel for more than one purpose at time, such as sending messages along with broadcasting, following, or evading.
Use the following examples to send message 4 at intensity 5:
JavaScript: sendIRMessage(4, 5)
Python: send_ir_message(4, 5)
Parameters:
channel {number} - IR channel that sends a message (0 to 7)
intensity {number} - The transmission intensity (1 to 64)
Compatible Robots:
BOLT, BOLT+, RVR, RVR+