How to use/test sensors blocks?

How to use/test sensors blocks?

Sensor Context

Sensor context is used for performing any kind of sensor operations in the program.
  1. 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 pressedReturns value in the range of 1000 to 1023
Sensor is not pressedReturns value in the range of 0 to 15
Intermediate value700

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 spotsReturns value in the range of 0 to 150
White spotsReturns value in the range of 700 to 750
Intermediate value350

Sample code

For LITE2.0 BLE Brain


For FULL2.0 BLE brain