Line

LINE category blocks monitor the IR sensors on the underside of the Scribbler 3 Robot.


line sensor calibrate

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.


detect line

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 center: consider a detection successful if the entire sensor is over a line
  • the left edge: consider a detection successful if the sensor is over the left edge of a line
  • the right edge: consider a detection successful if the sensor is over the right edge of a line
  • any part: consider a detection successful if any part of the sensor is over a line

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.


line sensor reading

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).


DEPRECATED: detect line (old version)

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: