I have a ultrasonic sensor and water pump that connect to Photon board. The reading of ultrasonic sensor will be display on Android phone. I’m using MIT app inventor 2 to done this. Besides, I also make 2 button on the app to turn on/off the water pump. I had completed the sensor reading part. However, i cannot make the button to turn on the pump yet. So, I hope those who had experience on this can give me a help. Thank you.
Below is the sensor reading part that i had done using MIT app inventor 2.
The MIT app inventor side should look something like this. (I might be getting the json list wrong)
The idea is to do a POST request and the block BuildRequestData will make it into a form that the API endpoint (https://docs.particle.io/reference/api/#call-a-function) wants. The missing piece is if i got the json part correct or not.
Follow this link and it will help with making the buttons work - then couple it with the sensor readings to be displayed.
Note the >return 200 value in the photon code doesn't do anything in App inventor.
hope it helps, if not I will post what I have working