How to use/test sensors blocks?
Sensor Context
Sensor context is used for performing any kind of sensor operations in the program.
- Read Touch sensor
Read touch sensor block reads the value of Avishkaar touch sensor on the defined port. You can perform any particular task on the basis of touch input and select the port to which your sensor is connected. the values on which Avishkaar touch sensor works are as shown below:
Sensor is pressed | Returns value in the range of 1000 to 1023 |
Sensor is not pressed | Returns value in the range of 0 to 15 |
Intermediate value | 700 |
Sample code:
For LITE2.0 BLE brain
For FULL2.0 BLE brain
b. Read IR sensor
Read IR Sensor block reads the value of Avishkaar Infrared (IR) sensor on the defined port. You ca perform any particular task on the basis of IR input which senses black and white spots and selects the port on which your sensor is connected.
The values on which Avishkaar IR sensor works are shown below:
Black spots | Returns value in the range of 0 to 150 |
White spots | Returns value in the range of 700 to 750 |
Intermediate value | 350 |
Sample code
For LITE2.0 BLE Brain
For FULL2.0 BLE brain