7 Photosensitive gesture

From Banana Pi Wiki
Revision as of 00:45, 19 February 2019 by Sinovoip (talk | contribs)
Jump to navigation Jump to search

Photosensitivity and gesture detection

photosensitive sensor

Careful students may have found, in the bpibit board above two such things, yes, these two things are photosensitive sensor. It is a light-sensitive sensor that, through a sampling circuit, converts the intensity of light into the magnitude of the voltage.

Its model is PTSMD021 click to learn more

Get the intensity of the light

There is a light module in the firmware. We can easily get the light intensity by calling the function in this module.

sample code

import light
from time import sleep_ms
R = light.Intensity(39)
L = light.Intensity(36)
while True:
   print('R=',R.read())
   print('L=',L.read())
   sleep_ms(1000)