Using sensors

From Smart Box
Revision as of 03:15, 12 October 2023 by Benryves (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

You can attach various sensors to Smart Box and then write a Smart Move program which uses the reading from a sensor to determine whether or not to carry out a command. The sensors will return a value when you ask Smart Move to check them. The digital sensors will return either a 1 or a 0, the analogue sensors will return a number dependent on the reading from the sensor.

Connect the temperature sensor into sensor socket A.

fig. 10

You will notice that the screen display changes to show the sensor name.

Type PRINT Temp < Enter >

A reading from sensor A will be printed in the output window. You can use the sensors in a number of ways. The program can wait for a sensor to change before doing something, or you can choose between two actions depending on the sensor state.