Making decisions
Jump to navigation
Jump to search
In many cases you will want to make your program choose between one action or another depending on the sensor reading. One example of this is given in fig. 11. This procedure will constantly check the temperature and switch on either one of two lamps depending on the reading.

How it works. The REPEAT and UNTIL lines form a loop. The lines within the loop will repeat until sensor A falls below 10. Each time round the loop Smart Move checks the sensor. If the temperature is above 25°C digital output 1 will light, if it is below 25°C digital output 2 will light.