Particle Photon with MIT App Inventor 2

I have a ultrasonic sensor to sense the distance of an object and display it on a Android phone.
I’m using MIT App Inventor 2 to develop the Android apps. I know the way to link the Photon with MIT app inventor, but I does not know how to make the MIT app Inventor show the reading from the sensor. I hope can get some help from anyone. Thank you.

Best Regards,
S.Y.

You can try exposing a Particle variable that returns the distance read by the ultrasonic sensor whenever you poll for the variable.

The corresponding API call will look something like the documented one: https://docs.particle.io/reference/api/#get-a-variable-value

1 Like