Hi TOM,
My app is HTML/JavaScript based. I use the App to display a Webviewer page, and to communicate with the Arduino. All my functions, on/off timers, buttons and coding is written in JavaScript and HTML. I chose this method mainly because the layout capabilities of App Inventor are very poor, and I wanted my App to look professional.
There is a JavaScript timer on the HTML page that fires every 200ms, it sends a “Read Only” request to the app that’s the “o” you are asking about. When the app see this, it sends a request for read only data from Arduino.
When a user changes any settings on the HTML page, it sends a “Save Request”, and saves the values to Tinydb. So when the App is reloaded all user settings are sent back to the HTML page and restored.
When any setting is changed that needs to be sent to Arduino, to turn something on/off, etc. Then the HTML page sends a “Send Data” request, and the values are sent to Arduino.
It works extremely well, it is even fast enough to send the PWM signals from Arduino in real time, so as the lights are ramping up, the percentage of brightness is updating in real time on the HTML page.
And also because it is being displayed on the Webviewer, and not on an App Inventor screen, and the fact that the JavaScript timer sends a request for “Read Only” data to the App every 200ms, the App will not go into sleep mode, so it can run 24/7 with no problems.
I designed the App to be used on a 7” tablet, dedicated for use as the Main Controller.
Here is a screen shot, I am still tweaking the graphical layout a bit, but the main coding is done, except for the Aquarium water parameters and Livestock log data base.
Mike.