Please note: Friday June 18 is a holiday celebrating Juneteenth, please allow extra time for your order to arrive and plan accordingly.
0

proximity sensor
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

proximity sensor

by Gstvgrc on Sun Nov 08, 2020 2:16 pm

Hi everyone. I'm a newbie with CPX: Trying to use the Infrared receiver / transmitter as a proximity sensor but can't find tutorials for MakeCode:

"... By bouncing IR light off of items and reading the reflected light, you can also do very simple proximity sensing!" ...

and

"... There's also a secret capability, you can read the 'raw' analog value from the receiver LED diode to do basic IR proximity sensing. The direct analog value is available from pin A10..."

Any ideas? thanks

Gstvgrc
 
Posts: 10
Joined: Wed Mar 13, 2019 2:19 pm

Re: proximity sensor

by johnpark on Mon Nov 09, 2020 12:03 pm

Unfortunately, using IR as proximity sensing isn't exposed in MakeCode (that description in the CPX main page you quoted applies to CircuitPython and Arduino). However, you can use the light level block in MakeCode to do something roughly similar.

johnpark
 
Posts: 870
Joined: Wed Mar 25, 2009 2:15 pm

Re: proximity sensor

by Gstvgrc on Mon Nov 09, 2020 12:31 pm

Thanks for your time

Gstvgrc
 
Posts: 10
Joined: Wed Mar 13, 2019 2:19 pm

Please be positive and constructive with your questions and comments.