How can I constantly output analogRead value to a PC/LCD screen?

For a university project we needed to transition from a regular Arduino to Photon so that the final product would be independent of “expensive” hardware like a laptop. However, to test our measurements, we need a way to constantly read values to at least a laptop (with no cable connection), and the only way I’ve found so far is to use

particle variable get [photon] analogvalue

This, of course, means I can get only one reading per the time interval it takes to copy and paste the command into the console, and is thus completely irrelevant for time-bound measurements
How can we ‘automate’ it or obtain a result somewhat close to Arduino’s serial-read option?

(This is the first day of me using a Photon, I could’ve missed an important chunk of information while trying to get at least some kind of results)

You can send data via WiFi using TCP or UDP

This project might be helpful

2 Likes

There are many ways to do this, depending on other requirements and how much work you want to do. For example, this is part of the display for my house that I have on a secondary monitor on one computer, and two cheap Android tablets around the house.

Screen Shot 2022-10-24 at 5.11.21 AM

The Particle Photon and Argon devices communicate by UDP multicast over my LAN. This eliminates the use of data operations, and allows for fast and frequent updates for some sensors, like the wind speed sensor.

There are some cellular (Boron) devices that communicate using Particle.publish as they do not frequently transmit data.

The missing piece for the browser interface is a small server written in node.js. This is necessary because browsers can’t access UDP multicast, so the node server monitors the UDP multicast and converts it into server sent events (SSE) that the browser can display, basically in real-time.

2 Likes

is there a way to store data locally (on photon) to perform calculations locally too before sending the relevant data?

There is of course

And this gives you the amount of free RAM to use.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.