#RedBot_Line_Follower_Bar
##Example Sketch Descriptions
-
AveragingFollower
Does a sort of over-sampling on the sensor readings, doesn't work too well -
AveragingReadBarOnly
Like the AveragingFollower but doesn't drive, outputs serial -
LessBasicFollower
Like the MostBasicFollower with an additional "corner detected" action -
MostBasicFollower
Simply tries to steer towards center. After playing with the sensor, run this sketch on an actual robot course -
NintendoControlled
run the redBot by XBee! Need to form a packet on the airwaves... -
ReadBarOnly
Dump the various method calls to the serial term. This is a good place to start
##Method Descriptions
####SensorBar::SensorBar()
This is the constructor. It takes no arguements and does nothing.
####uint8_t SensorBar::getRaw( void )
The method getRaw() takes no arguements and returns a picture of what the bar sees in bits.
If the bar sees a line (dark) under the left most two sensors, getRaw() would return 0xC0, or 1100000b
####int8_t SensorBar::getPosition( void )
Use this method to get an average direction of where the line is, as a number from -127 to 127.
With the left most two detectors example, this method returns decimal 111.
If the left 4 are covered, it returns 79.
A way to conceptualize this method is that it returns a 1 dimetional vector that points to the center of the density of the detected line.
####uint8_t SensorBar::getDensity( void )
This method returns the number of sensors that detect dark, 0 through 8.
####void SensorBar::scan( void )
This method must be periodically called! It operates the I2C machine and updates the internal class members so that the other functions work