The SENSOR blocks are used to control and monitor the onboard sensors of the Scribbler 3 Robot.
This block category contains the following subcategories: LINE, OBSTACLE, LIGHT, STALL, SONY REMOTE, MICROPHONE, and BUTTON.
LINE category blocks monitor the IR sensors on the underside of the Scribbler 3 Robot.
The line sensor calibrate block, used at the very beginning of a line following program, helps the line following sensors determine how reflective the line and the background surface are. The Scribbler robot will spin in a complete circle - place it so that as it rotates, it can see both the line and the background. Once calibration has completed, it will store a "line threshold" value into the Scribbler's EEPROM memory for use by the detect line block.
The detect line block has 3 selectable conditions. When the S3 line sensors detect a condition matching the block conditions selected by the user, this block will execute any program blocks inside of it.
The first condition determines whether or not to provide a true (when "is" is selected) or false (when "is not" is selected) value when the conditions specified by the other two drop-down menus have been met.
The second condition determines what part of a line to try and detect, with the following options:
The third condition defines whether the S3 is looking for a black line on a white surface or a white line on a black surface.
The line sensor reading block returns the current line sensor reflection reading, a value between 0 and 100, for either the left or right line sensor depending on which is selected. Reflectivity depends on surface color; darker surfaces have less reflectivity (closer to 0), lighter surfaces have more (closer to 100).
This block has been deprecated. It will still work in programs that already include it, but it is not available for use in new programs. It may also appear orange, signifying that a newer block is available and should be used. It was replaced to provide more flexibility by allowing both if and else conditions when combined with the if...do block.
The functionality of this block can be recreated using a handful of other blocks. Most users will be able to combine the if...do block with the current detect line block:
For users who needed the functionality provided by the "was" and "was not" conditions, you can set up two variables to track the current and past values of the line sensor:
OBSTACLE blocks monitor the two IR LEDs (emitters) and receiver on the front of the Scribbler 3 Robot.
The detect obstacle block has 2 selectable conditions. If the obstacle sensor readings match the block conditions selected by the user, the detect obstacle block provides a value of true or false.
The first condition determines whether the block returns true (if the obstacle is detected) or false (if the obstacle is not detected).
The second condition determines what the obstacle sensor readings should be, with the following options:
This block has been deprecated. It will still work in programs that already contain it, but it is not available in new programs. It may also appear orange, signifying that it should be replaced as soon as possible. This block has been replaced to provide more flexibility by allowing both if and else conditions when combined with the if...do block.
The functionality of this block can be recreated using a handful of other blocks. Most users will be able to combine the if...do block with the current detect line block:
For users who needed the functionality provided by the "was" and "was not" conditions, you can set up two variables to track the current and past values of the line sensor:
LIGHT blocks monitor the three phototransistors on the top-front of the Scribbler 3 Robot.
The light sensed block has 2 selectable conditions. If the light sensor readings match the block conditions selected by the user, then the light sensed block provides a value of true or false.
The first condition determines whether the block returns true or false based on whether the most (brightest) or least (darkest) amount of light is detected by the individual light sensor specified by the second drop-down menu.
The second condition determines which individual light sensor (front, right, or left) is detecting the most or least amount of light.
The light sensor reading block returns the current light level value, between 0 and 100, from either the left, center, or right light sensor in the top front of the Scribbler robot (whichever has been selected by the user). The value increases as the brightness of the light increases.
This block has been deprecated. It will still work in programs that already contain it, but it is not available in new programs. It may also appear orange, signifying that it should be replaced as soon as possible. It was replaced to provide more flexibility by allowing both if and else conditions when combined with the if...do block.
The functionality of this block can be recreated using a handful of other blocks. Most users will be able to combine the if...do block with the current detect line block:
For users who needed the functionality provided by the "was" and "was not" conditions, you can set up two variables to track the current and past values of the line sensor:
The second condition determines what the light sensor readings should be, with the following options:
STALL blocks monitor the encoders within the Scribbler 3 Robot responsible for detecting tail wheel and drive wheel rotation.
The detect stall block allows for the detection of stalled drive wheels, a stalled tail wheel, or an overall stall condition ("stuck"). If the specified sensor/system stalls, the detect stall block provides a value of true (is) or false (is not).
The detect stall block needs to be used with the following tips in mind:
These blocks have been deprecated. They will still work in programs that already have them, but they are not available for new programs. They may also appear orange, signifying that they should be replaced as soon as possible. These blocks were replaced to provide more flexibility by allowing both if and else conditions when combined with the if...do block.
The functionality of the detect stall (old) block can be recreated using a handful of other blocks. Most users will be able to combine the if...do block with the current detect stall block:
For users who needed the functionality provided by the "was" and "was not" conditions, you can set up two variables to track the current and past values of the stall sensor:
BlocklyProp block reference for using a Sony protocol remote and infrared receiver with the S3 robot.
An IR receiver can detect bursts of infrared light sent by a remote controller (like that used for television), and then output a pattern of high/low signals to a Propeller I/O pin.
Configure your remote for Sony protocol, following its manufacturer instructions. If you purchased the Brightstar brand remote from Parallax (#020-00001), hold the Setup button until the light near it comes on. Enter 6-0-5 and the light should go off. Done!
The Sony Remote value block returns a value detected by the IR receiver that indicates which button on the remote is pressed. If no button press is detected, then this block provides a value of -1.
This block's drop-down menu selects the Propeller I/O pin connected to an infrared receiver. When using the S3 board type, the default option is the onboard IR sensor (which is connected to P20). However, the drop-down also gives the option of connecting to P0... P5 on the S3's Hacker Port.
The microphone block provides a value based on the loudness of any sounds it is detecting. The value of the block ranges from 0 (silence) to 100 (extremely loud).
The BUTTON block monitors the blue reset button on the top-rear of the Scribbler 3 robot.
The button sensor block monitors and returns the number of times (0-8) the Scribbler 3 reset button is pressed in succession.