ADC
Reading a potentiometer is not something new.
Reading it from the Raspberry PI is interesting, but there is no reason to climb the curtains!
But wait..., with the Raspberty PI connected on the Internet, you can broadcast the value read from the potentiometer to whoever is interested, for example via the WebSocket protocol.
This is the beauty of this little thingies of the Internet...
They're connected on one side to the Internet, and on the other to some sensor(s), like the Raspberry PI with its GPIO interface.
We provide here a full running example, running on top of node.js.
Find here an article about the way to install node on the Raspberry PI.
We need:
Prompt> npm install websocket
And this is pretty much all you will need. The server version presented here does not use Express. This would be an option, and would make the code a bit simpler.
Display it if full screen for more details
And here is what it can look like when you have a WebSocket server in the picture.
See the breadborad, the server console running on the Raspberry PI, and the rendering in a browser running on a tablet (Android in this case).
Display it if full screen for more details
adc.sample.WebSocketFeeder.
server.js.
adc.sample.WebSocketFeeder feeds, hosted by the server defined by server.js.
Prompt> cd node
Prompt> node server.js
Prompt> ./run.ws 0
You will notice in the script run.ws that you can use a System variable named ws.uri to set the uri of the WebSocket to feed, in case it is not just ws://localhost:9876/.
http://raspberrypi:9876/data/display.html