Datasheet

Table Of Contents
36
revolution
(c) Copyright Revolution Education Ltd. Web: www.picaxe.co.uk Version 1.1 04/10
BOT120.PMD
BOT120 PICAXE-20X2 MICROBOT
Programming Example 11 – Light Follower
The following program demonstrates using your Microbot as a light
following robot.
The left LDR sensor should be fitted to the front left connection point of
the motherboard ( Pin C.1 / ADC 7 ) and the right LDR sensor should be
fitted to the right connection point ( pin C.3 / ADC 9 ). To do this you
will need to remove the bumper if it was previously connected.
An optional SRF005 Ultrasound Module may also be connected to the
centre front connection point of the motherboard (pin C.2 )
Your Microbot will read the light intensity on each of its LDRs then check
to see if there is any obstacle in front of itself. When there is an obstacle,
your Microbot will stop the motors and it will wait until the obstacle is
removed.
When there is no obstacle, your Microbot will determine which of the
left or right LDR sensors has the greatest level of light shining on them
and determine how much greater the light is in one LDR than the other.
When there is a significant difference in light level your Microbot will
turn in the direction of the brightest, when there is no significant
difference between the light levels it will move forwards towards the
light.
Being attracted to light is also very similar to being repulsed by darkness.
If one LDR enters shade and the light level on one LDR is significantly
less than the other then this is the same as the other LDR is brighter. Your
Microbot will turn towards the brighter light and away from the
darkness.
Sample Logicator Flowchart File:
BOT120 LIGHT FOLLOWER.PLF