All 5 gauges work just fine but I am unable to get these switches to respond. I don't even want the switch to work far as turning on or off any relays I just want a status of on or off and since this HTML was already built I figured to use the switches as status.
#include <SPI.h> //Standard Library
#include <Ethernet.h> //Standard Library
#include <EthernetUdp.h> //Standard Library
#include <SD.h>
#include <max6675.h>
/* set the desired subnet and universe (first universe is 0)
sACN starts with universe 1 so subtract 1 from sACN universe
to get DMX_UNIVERSE. */
#define ARTNET_SUBNET 0 //defualt subnet is 0. Should not need to be changed.
#define ARTNET_UNIVERSE 1 //first universe being used
#define IPaddress 10, 27, 2, 95 //ipaddress
#define ETHERNET_BUFFER_MAX 640
#define ARTNET_ARTDMX 0x5000
#define ARTNET_ARTPOLL 0x2000
#define ARTNET_PORT 0x1936 //standard port
#define ARTNET_START_ADDRESS 18 //Byte 18 in the packet contains channel 1 values.
#define STATUS_LED 13 //shows us when we are receiving data
#define SDCARD_CONTROL 4 //set pin 4 to high to disable SD card interface on WiFi shield
#define NUM_RELAYS 4 //total number of relays used
#define REQ_BUF_SZ 50
#define WEBSERVER_PORT 80
File HMTL_file;
const int fuelVolume = 100; // The amount of fuel in the firing chamber
const int thresholdPressure = 25; // Threshold pressure in PSI
const int pilotTemp = 60;
unsigned int flowRate; // The flow rate of fluid
unsigned int flowMilliLiters; // The cumulative amount of fluid in milliliters
int channel1 = 0; //channel 1
int channel2 = 1; //channel 2
//Sensor Pins
const int flowSensor = 21; // The pin number for the flow sensor
const int pressureSensorPin = A8; // Pin connected to the pressure sensor
int thermoDO = 14;
int thermoCS = 15;
int thermoCLK = 16;
MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
//Relay Pins array
const int pumpPin = 22; // The pin number for the Fuel Pump
const int nitrogenPin = 24; // Pin connected to the nitrogen valve
const int pilotPin = 26; // Pin connected to the pilot light
const int firePin = 28; // Pin connected to Fire Dragon Firing
const int firereadyPin = 30; // Pin connected to Fire Dragon Firing
//Timer Setup
volatile byte currentcounter = 0; //counter for data reception
byte previouscounter = 0; //counter for data reception
unsigned long currentDelay = 0; //current time value for ArtNet and E1.31 reception
unsigned long prevTime1 = millis();
const unsigned long interval1 = 1000; //1 second timer
unsigned long previousTime = 0;
//Ethernet Configuration
byte mac[] = { 0x00, 0xDD, 0xEE, 0x01, 0x10, 0x90 };
IPAddress ip(IPaddress); //IP address of ethernet shield
EthernetServer server(WEBSERVER_PORT); // create a server at port
File webFile; // the web page file on the SD card
char HTTP_req[REQ_BUF_SZ] = { 0 }; // buffered HTTP request stored as null terminated string
char req_index = 0; // index into HTTP_req buffer
// buffer to hold E1.31 and Artnet data
unsigned char packetBuffer[ETHERNET_BUFFER_MAX];
// An EthernetUDP instance to let us send and receive packets over UDP
// aUDP creates a socket for an Art-Net port
EthernetUDP aUDP;
void setup() {
pinMode(10, OUTPUT);// disable Ethernet chip
pinMode(flowSensor, INPUT);
pinMode(pressureSensorPin, INPUT);
pinMode(pumpPin, OUTPUT);
pinMode(nitrogenPin, OUTPUT);
pinMode(pilotPin, OUTPUT);
pinMode(firePin, OUTPUT);
pinMode(firereadyPin, OUTPUT);
pinMode(STATUS_LED, OUTPUT); //Initialize status LED
pinMode(SDCARD_CONTROL, OUTPUT); //Initialize Pin 4
digitalWrite(pumpPin, HIGH); //set fuel pump to high for off
digitalWrite(nitrogenPin, HIGH); //set nitrogen to high for off
digitalWrite(pilotPin, HIGH); //set pilot lite to high for off
digitalWrite(firePin, HIGH);
digitalWrite(10, HIGH);// disable Ethernet chip
digitalWrite(SDCARD_CONTROL, HIGH); //Set pin 4 to high since we are not using the SD Card interface
Ethernet.begin(mac, ip); //Initialize Ethernet shield
aUDP.begin(ARTNET_PORT); //Open Artnet Port
Serial.begin(9600); //Serial for debugging
server.begin(); // start to listen for clients
Serial.println("Setup Complete"); //print complete
// initialize SD card
Serial.println("Initializing SD card...");
if (!SD.begin(4)) {
Serial.println("ERROR - SD card initialization failed!");
return; // init failed
}
Serial.println("SUCCESS - SD card initialized.");
// check for index.htm file
if (!SD.exists("index.htm")) {
Serial.println("ERROR - Can't find index.htm file!");
return; // can't find index file
}
Serial.println("SUCCESS - Found index.htm file.");
}
/* artDMXReceived checks the universe and subnet then
outputs the data to the relays */
void artDMXReceived(unsigned char* pbuff) {
if ((pbuff[14] & 0xF) == ARTNET_UNIVERSE) {
if ((pbuff[14] >> 8) == ARTNET_SUBNET) {
if (pbuff[ARTNET_START_ADDRESS + channel1] == 200) //if channel value is 200
{
flowRate = pulseIn(flowSensor, HIGH); // Read the flow rate
flowMilliLiters += (flowRate / (60 * 7.5)); // Calculate the cumulative amount of fluid
if (flowMilliLiters >= fuelVolume) { // If the cumulative amount of fluid is greater than or equal to 1000 ml
digitalWrite(pumpPin, HIGH); // Turn off the relay
} else { // If the cumulative amount of fluid is greater than or equal to 1000 ml
digitalWrite(pumpPin, LOW); // Turn off the relay
}
{
if (flowMilliLiters >= fuelVolume) {
digitalWrite(pilotPin, LOW);
}
int pressure = analogRead(pressureSensorPin); // Read the pressure sensor
pressure = map(pressure, 0, 1023, 0, 250); // Map the reading to PSI
if (flowMilliLiters >= fuelVolume) {
digitalWrite(nitrogenPin, LOW); // Keep the relay on
}
{
if (pressure >= thresholdPressure) { // If pressure is above threshold
digitalWrite(nitrogenPin, HIGH); // Turn off the relay
}
}
}
double celsius = thermocouple.readCelsius();
int pressure = analogRead(pressureSensorPin); // Read the pressure sensor
pressure = map(pressure, 0, 1023, 0, 250); // Map the reading to PSI
while (pbuff[ARTNET_START_ADDRESS + channel2] == 200 && pressure >= thresholdPressure && flowMilliLiters >= fuelVolume && celsius > pilotTemp) {
digitalWrite(firePin, LOW); //Fire
Serial.println("FIREING!!!!!!!!");
delay(10000);
digitalWrite(firePin, HIGH);
digitalWrite(pumpPin, HIGH);
digitalWrite(nitrogenPin, HIGH);
digitalWrite(pilotPin, HIGH);
(flowMilliLiters = 0);
delay(5000);
return (setup());
}
} else {
digitalWrite(pumpPin, HIGH);
digitalWrite(nitrogenPin, HIGH);
digitalWrite(pilotPin, HIGH);
return;
}
}
}
}
//end artDMXReceived
/* artNetOpCode checks to see that the packet is actually Art-Net
and returns the opcode telling what kind of Art-Net message it is. */
int artNetOpCode(unsigned char* pbuff) {
String test = String((char*)pbuff);
if (test.equals("Art-Net")) {
if (pbuff[11] >= 14) { //protocol version [10] hi byte [11] lo byte
return pbuff[9] * 256 + pbuff[8]; //opcode lo byte first
}
}
return 0;
}
/************************************************************************
The main loop checks for and reads packets from the two UDP ethernet
socket connections. When a packet is recieved, it is checked to see if
it is valid and then one of the DMXReceived functions is called, sending
the DMX values to the output. There also is a timer to run a standby
program if no data is received for 30 seconds.
*************************************************************************/
void loop() {
if (currentcounter != previouscounter) //has the value changed?
{
currentDelay = millis(); //store the time since the value has increased
previouscounter = currentcounter; //set the previous value equal to the current value
}
if (millis() - currentDelay > 30000) //is the time since the value changed greater than 30 seconds?
{
digitalWrite(STATUS_LED, HIGH); //turn LED off. Not receiving E1.31 or ArtNet.
}
// first check to see if a packet is available on the Art-Net port
int packetSize = aUDP.parsePacket();
if (packetSize) {
aUDP.read(packetBuffer, ETHERNET_BUFFER_MAX);
/* after reading the packet into the buffer, check to make sure
that it is an Art-Net packet and retrieve the opcode that
tells what kind of message it is */
int opcode = artNetOpCode(packetBuffer);
if (opcode == ARTNET_ARTDMX) {
artDMXReceived(packetBuffer);
currentcounter++; //increase counter by 1 each time through
digitalWrite(STATUS_LED, HIGH); //turn status LED on
}
}
EthernetClient client = server.available(); // try to get client
if (client) { // got client?
boolean currentLineIsBlank = true;
while (client.connected()) {
if (client.available()) { // client data available to read
char c = client.read(); // read 1 byte (character) from client
// buffer first part of HTTP request in HTTP_req array (string)
// leave last element in array as 0 to null terminate string (REQ_BUF_SZ - 1)
if (req_index < (REQ_BUF_SZ - 1)) {
HTTP_req[req_index] = c; // save HTTP request character
req_index++;
}
// last line of client request is blank and ends with \n
// respond to client only after last line received
if (c == '\n' && currentLineIsBlank) {
// send a standard http response header
client.println("HTTP/1.1 200 OK");
// remainder of header follows below, depending on if
// web page or XML page is requested
// Ajax request - send XML file
if (StrContains(HTTP_req, "ajax_inputs")) {
// send rest of HTTP header
client.println("Content-Type: text/xml");
client.println("Connection: keep-alive");
client.println();
// send XML file containing input states
XML_response(client);
} else { // web page request
// send rest of HTTP header
client.println("Content-Type: text/html");
client.println("Connection: keep-alive");
client.println();
// send web page
webFile = SD.open("index.htm"); // open web page file
if (webFile) {
while (webFile.available()) {
client.write(webFile.read()); // send web page to client
}
webFile.close();
}
}
// display received HTTP request on serial port
Serial.print(HTTP_req);
// reset buffer index and all buffer elements to 0
req_index = 0;
StrClear(HTTP_req, REQ_BUF_SZ);
break;
}
// every line of text received from the client ends with \r\n
if (c == '\n') {
// last character on line of received text
// starting new line with next character read
currentLineIsBlank = true;
} else if (c != '\r') {
// a text character was received from client
currentLineIsBlank = false;
}
} // end if (client.available())
} // end while (client.connected())
delay(1); // give the web browser time to receive the data
client.stop(); // close the connection
} // end if (client)
}
// send the XML file containing analog value
void XML_response(EthernetClient cl) {
int analog_val;
double celsius = thermocouple.readCelsius();
int pressure = analogRead(pressureSensorPin); // Read the pressure sensor
pressure = map(pressure, 0, 1023, 0, 250); // Map the reading to PSI
int flowRate = pulseIn(flowSensor, HIGH);
int strSW1;
cl.print("<?xml version = \"1.0\" ?>");
cl.print("<inputs>");
analog_val = flowMilliLiters += (flowRate / (60 * 7.5));
cl.print("<analog>");
cl.print(analog_val);
cl.print("</analog>");
analog_val = (celsius);
cl.print("<analog>");
cl.print(analog_val);
cl.print("</analog>");
analog_val = (pressure);
cl.print("<analog>");
cl.print(analog_val);
cl.print("</analog>");
analog_val = (A9);
cl.print("<analog>");
cl.print(analog_val);
cl.print("</analog>");
analog_val = (A10);
cl.print("<analog>");
cl.print(analog_val);
cl.print("</analog>");
cl.print("</inputs>");
}
// sets every element of str to 0 (clears array)
void StrClear(char* str, char length) {
for (int i = 0; i < length; i++) {
str[i] = 0;
}
}
// searches for the string sfind in the string str
// returns 1 if string found
// returns 0 if string not found
char StrContains(char* str, char* sfind) {
char found = 0;
char index = 0;
char len;
len = strlen(str);
if (strlen(sfind) > len) {
return 0;
}
while (index < len) {
if (str[index] == sfind[found]) {
found++;
if (strlen(sfind) == found) {
return 1;
}
} else {
found = 0;
}
index++;
}
return 0;
}
//End loop
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dragon Fire</title>
<center>
<img src="https://stlshuttleservice.com/wp-content/uploads/2023/02/KRS-ENT-LOGO.png" width="200" height="180">
</center>
<script src="https://cdn.jsdelivr.net/npm/canvas-gauges"></script>
<script>
var dataValOne = 0;
var dataValTwo = 0;
var dataValThree = 0;
var dataValFour = 0;
var dataValFive = 0;
strSW1 = "";
strSW2 = "";
strSW3 = "";
strSW4 = "";
function GetArduinoInputs()
{
nocache = "&nocache=" + Math.random() * 1000000;
var request = new XMLHttpRequest();
request.onreadystatechange = function()
{
if (this.readyState == 4) {
if (this.status == 200) {
if (this.responseXML != null) {
<!-- gauge values -->
dataValOne = this.responseXML.getElementsByTagName('analog')[0].childNodes[0].nodeValue;
dataValTwo = this.responseXML.getElementsByTagName('analog')[1].childNodes[0].nodeValue;
dataValThree = this.responseXML.getElementsByTagName('analog')[2].childNodes[0].nodeValue;
dataValFour = this.responseXML.getElementsByTagName('analog')[3].childNodes[0].nodeValue;
dataValFive = this.responseXML.getElementsByTagName('analog')[4].childNodes[0].nodeValue;
<!-- switch values -->
// SWITCH 1
if (this.responseXML.getElementsByTagName('SW')[0].childNodes[0].nodeValue === "checked") {
document.SW_form.SW1.checked = true;
}
else {
document.SW_form.SW1.checked = false;
}
// SWITCH 2
if (this.responseXML.getElementsByTagName('SW')[1].childNodes[0].nodeValue === "checked") {
document.SW_form.SW2.checked = true;
}
else {
document.SW_form.SW2.checked = false;
}
// SWITCH 3
if (this.responseXML.getElementsByTagName('SW')[2].childNodes[0].nodeValue === "checked") {
document.SW_form.SW3.checked = true;
}
else {
document.SW_form.SW3.checked = false;
}
// SWITCH 4
if (this.responseXML.getElementsByTagName('SW')[3].childNodes[0].nodeValue === "checked") {
document.SW_form.SW4.checked = true;
}
else {
document.SW_form.SW4.checked = false;
}
}
}
}
}
request.open("GET", "ajax_inputs" + strSW1 + strSW2 + strSW3 + strSW4 + nocache, true);
request.send(null);
setTimeout('GetArduinoInputs()', 1000);
strSW1 = "";
strSW2 = "";
strSW3 = "";
strSW4 = "";
}
// service SWITCHES when toggles checked/unchecked
function SwitchCheck()
{
if (SW_form.SW1.checked) {
strSW1 = "&SW1=1";
}
else {
strSW1 = "&SW1=0";
}
if (SW_form.SW2.checked) {
strSW2 = "&SW2=1";
}
else {
strSW2 = "&SW2=0";
}
if (SW_form.SW3.checked) {
strSW3 = "&SW3=1";
}
else {
strSW3 = "&SW3=0";
}
if (SW_form.SW4.checked) {
strSW4 = "&SW4=1";
}
else {
strSW4 = "&SW4=0";
}
}
</script>
<style>
html,
body {
width: 100%;
height: 100%;
background-color: black;
display: table-cell;
vertical-align: middle;
}
html {
display: table;
}
h1 {
font-family: arial, verdana, sans-serif;
text-align:center;
color:white;
font-size:18px;
letter-spacing:1px;
}
h3 {
font-family: arial, verdana, sans-serif;
text-align:center;
color:white;
font-size:40px;
text-transform: uppercase;
letter-spacing:3px;
}
td {
color:white;
border: 0px solid white;
white-space: nowrap;
vertical-align: bottom;
}
#table_G1{
table-layout: auto;
width: 70%;
height: 200px;
border: 0px solid white;
text-align:center;
}
#table_G2{
table-layout: auto;
width: 50%;
height: auto;
border: 0px solid white;
text-align:center;
}
#table_S{
table-layout: auto;
width: 45%;
height: 100px;
border: 0px solid white;
text-align:center;
}
input[type="checkbox"] {
margin: 10px;
position:relative;
vertical-align: bottom;
margin-top:2em;
width:96px;
height:32px;
-webkit-appearance: none;
background: linear-gradient(0deg, #333, #000);
opacity: 0.8;
outline: none;
border-radius: 16px;
box-shadow: 0 0 0 4px #353535, 0 0 0 5px #3e3e3e, inset 0 0 10px rgba(0,0,0,1);
}
input[type="checkbox"]:before {
content:'';
position:absolute;
top:0;
left:0;
width:64px;
height:32px;
background: linear-gradient(0deg, #000, #6b6b6b);
border-radius: 16px;
box-shadow: 0 0 0 1px #232323;
transform: scale(.98,.96);
transition:.5s;
}
input:checked[type="checkbox"]:before {
left:32px;
}
input:checked[type="checkbox"]:after {
left:88px;
}
input:checked[type="checkbox"]:nth-of-type(1) {
background: linear-gradient(0deg, #70a1ff, #1e90ff);
box-shadow: 0 0 0 4px #353535, 0 0 0 5px #3e3e3e, inset 0 0 10px rgba(0,0,0,1);
}
input:hover {
opacity: 1;
}
</style>
</head>
<div id="body">
<body onload="GetArduinoInputs()">
<center>
<table id="table_G1">
<tr>
<!-- Fuel into Tank Gauge -->
<td align="center"><canvas id="gauge_1"
data-type="radial-gauge"
data-width="330"
data-height="330"
data-title="Fuel Tank Fill"
data-units="ML"
data-value="1500"
data-value-Int="1"
data-value-Dec="0"
data-animate-on-init="true"
data-animated-value="true"
data-min-value="0"
data-max-value="1500"
data-major-ticks="0,500,1000,1500"
data-minor-ticks="5"
data-highlights='[
{ "from": 0, "to": 1000, "color": "rgb(220, 50, 50,.75)" },
{ "from": 1000, "to": 1500, "color": "rgb(3, 148, 3,.75)" }
]'
data-color-needle-start="rgba(240, 128, 128, 1)"
data-color-needle-end="rgba(255, 160, 122, .9)"
data-value-box="true"
data-animation-rule="linear"
data-animation-duration="500"
data-border-outer-width="8"
data-border-middle-width="5"
data-border-inner-width="3">
</canvas>
</td>
<!-- Temperature Gauge -->
<td align="center"><canvas id="gauge_2"
data-type="radial-gauge"
data-width="330"
data-height="330"
data-units="℃"
data-title="Pilot Lite"
data-value="700"
data-value-Int="1"
data-value-Dec="0"
data-animate-on-init="true"
data-animated-value="true"
data-min-value="0"
data-max-value="700"
data-major-ticks="0,50,100,150,200,250,300,350,400,450,500,550,600,650,700"
data-minor-ticks="5"
data-highlights='[
{ "from": 0, "to": 60, "color": "rgba(220, 50, 50,.75)" },
{ "from": 60, "to": 700, "color": "rgba(3, 148, 3,.75)" }
]'
data-color-needle-start="rgba(240, 128, 128, 1)"
data-color-needle-end="rgba(255, 160, 122, .9)"
data-value-box="true"
data-animation-rule="linear"
data-animation-duration="500"
data-border-outer-width="8"
data-border-middle-width="5"
data-border-inner-width="3">
</canvas>
</td>
<!-- RPM Gauge -->
<td align="center"><canvas id="gauge_3"
data-type="radial-gauge"
data-width="330"
data-height="330"
data-title="In Tank PSI"
data-value="300"
data-value-Int="1"
data-value-Dec="0"
data-animate-on-init="true"
data-animated-value="true"
data-min-value="0"
data-max-value="300"
data-major-ticks="0,25,50,75,100,125,150,175,200,225,250,275,300"
data-minor-ticks="10"
data-highlights='[
{ "from": 0, "to": 150, "color": "rgba(220, 50, 50,.75)" },
{ "from": 150, "to": 300, "color": "rgba(3, 148, 3,.75)" }
]'
data-color-needle-start="rgba(240, 128, 128, 1)"
data-color-needle-end="rgba(255, 160, 122, .9)"
data-value-box="true"
data-animation-rule="linear"
data-animation-duration="500"
data-border-outer-width="8"
data-border-middle-width="5"
data-border-inner-width="3">
</canvas>
</td>
</tr>
</table>
<table id="table_G2">
<tr>
<!-- Fuel Tank Level Gauge 1 -->
<td align="center"><canvas id="gauge_4"
data-type="radial-gauge"
data-width="300"
data-height="300"
data-title="Fuel Tank Level"
data-value="2.5"
data-value-Int="1"
data-value-Dec="1"
data-animate-on-init="true"
data-animated-value="true"
data-min-value="0"
data-max-value="2.5"
data-major-ticks="0,0.5,1,1.5,2,2.5"
data-minor-ticks="0.25"
data-highlights='[
{ "from": 0, "to": 0.5, "color": "rgba(220, 50, 50,.75)" },
{ "from": 0.5, "to": 1, "color": "rgba(255, 255, 50,.75)" },
{ "from": 1, "to": 2.5, "color": "rgba(3, 148, 3,.75)" }
]'
data-color-needle-start='[
{ "from": 0, "to": 0.5, "color": "rgba(220, 50, 50,.75)" },
{ "from": 0.5, "to": 1, "color": "rgba(255, 255, 50,.75)" },
{ "from": 1, "to": 2.5, "color": "rgba(3, 148, 3,.75)" }
]'
data-color-needle-end="rgba(255, 160, 122, .9)"
data-value-box="true"
data-animation-rule="linear"
data-animation-duration="500"
data-border-outer-width="8"
data-border-middle-width="5"
data-border-inner-width="3">
<td width="400" style="vertical-align:middle;margin:0px 0px">
<center>
<img src="https://stlshuttleservice.com/wp-content/uploads/2023/02/22099-6-dragon.png" width="180" height="180">
<h3>Dragon Fire</h3>
</center>
</td>
<!-- Nitrgen tank PSI Gauge 2 -->
<td align="center"><canvas id="gauge_5"
data-type="radial-gauge"
data-width="300"
data-height="300"
data-title="Nitrogen"
data-value="3000"
data-value-Int="1"
data-value-Dec="0"
data-animate-on-init="true"
data-animated-value="true"
data-min-value="0"
data-max-value="3000"
data-major-ticks="0,500,1000,1500,2000,2500,3000"
data-minor-ticks="100"
data-highlights='[
{ "from": 0, "to": 500, "color": "rgba(220, 50, 50,.75)" },
{ "from": 500, "to": 1000, "color": "rgba(255, 255, 50,.75)" },
{ "from": 1000, "to": 3000, "color": "rgba(3, 148, 3,.75)" }
]'
data-color-needle-start="rgba(240, 128, 128, 1)"
data-color-needle-end="rgba(255, 160, 122, .9)"
data-value-box="true"
data-animation-rule="linear"
data-animation-duration="500"
data-border-outer-width="8"
data-border-middle-width="5"
data-border-inner-width="3">
</canvas>
</td>
</tr>
</table>
<table id="table_S">
<tr>
<form name="SW_form">
<td><center><input type="checkbox" name="SW1" value="0" onclick="SwitchCheck()" /><br /><br /></center></td>
<td width="75"></td>
<td><center><input type="checkbox" name="SW2" value="0" onclick="SwitchCheck()" /><br /><br /></center></td>
<td width="75"></td>
<td><center><input type="checkbox" name="SW3" value="0" onclick="SwitchCheck()" /><br /><br /></center></td>
<td width="75"></td>
<td><center><input type="checkbox" name="SW4" value="0" onclick="SwitchCheck()" /><br /><br /></center></td>
</form>
</tr>
<tr><td><H1>Fuel Pump</H1><td width=75></td><td><H1>Nitrogen</H1></td><td width=75></td><td><H1>Pilot</H1></td><td width=75></td><td><H1>Fire</H1></td></tr>
</table>
<center>
<br><br><H1><a href="krsentertainment.org" target="_blank">KRS Entertainment</a></H1></center>
<!-- update the gauges... -->
<script>
setInterval(function() {
document.getElementById("gauge_1").setAttribute("data-value", dataValOne);
document.getElementById("gauge_2").setAttribute("data-value", dataValTwo);
document.getElementById("gauge_3").setAttribute("data-value", dataValThree);
document.getElementById("gauge_4").setAttribute("data-value", dataValFour);
document.getElementById("gauge_5").setAttribute("data-value", dataValFive);
document.getElementById("gauge_6").setAttribute("data-value", dataValFive);
}, 1000);
</script>
</body>
</div>
</html>