proximity sensor

Microsoft's MakeCode platform for easy blocks-style programming

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Gstvgrc
 
Posts: 10
Joined: Wed Mar 13, 2019 2:19 pm

proximity sensor

Post by Gstvgrc »

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

User avatar
johnpark
 
Posts: 985
Joined: Wed Mar 25, 2009 2:15 pm

Re: proximity sensor

Post by johnpark »

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.

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

Re: proximity sensor

Post by Gstvgrc »

Thanks for your time

Locked
Please be positive and constructive with your questions and comments.

Return to “MakeCode”