Key Focus 4 - Automatic Headlights - TTS InO-Bot Blockly Teachers Manual

Table of Contents

Advertisement

This is an example of using a variable to set the pauses
throughout the tune. One change at the top of the
program will change the pauses throughout. Note: where a
longer pause is needed the tempo variable is doubled (* 2).
It could also be shortened by halving it (/ 2).
Key Focus 4 – Automatic headlights
InO-Bot has a range of sensors which can be used as input triggers. These triggers can
then activate outputs; for example to switch on headlights when dark.
The example on the right shows a conditional statement
('If...do...else' block) in use. 'If' the value from the light
sensor is less the 25 then 'do' turn the front lights on. 'If'
it's not less than 25 (25 or more) then 'else' turn them off.
The check needs to be run continually (not just once)
therefore a 'repeat while true' (forever) loop has been
used. Some experimentation will be required to work out what value the light sensor
should report to trigger the lights.
Note: See the user guide for more details on modifying 'if...do' blocks.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents