Using javascript to display data


#1

I’m not sure where to ask this because there’s so much I don’t know yet.

I have some Arduino background but Javascript is completely foreign to me. I have a particle photon and have some projects in mind. For the time being I want to learn how to simply display data on a web page. For example, is this switch open or closed? What is the value of this sensor? etc.

I am working my way through this book: “Getting Started with the Photon
Making Things with the Affordable, Compact, Hackable WiFi Module”

This is the firmware running on the device:
https://raw.githubusercontent.com/simonmonk/photon_book/master/firmware/examples/p_09_Lightmeter.cpp

This is the html on my page:

My question:
Instead of all of the fancy meters and visuals, how would I simply display the same data, in plain text?


#2

Hi @decoy5657

You should check out my example here:

Reading Spark Variables with Your Own HTML File

The basic idea is that find an area of the web page by its ID and then update it.


#3

Hi @decoy5657

Curios what are you using to get a reading of volts? Is it the volts of the Photon?


#4

it’s the voltage of a photocell