I am currently trying to connect my WiShield v1.0 to my wifi router. I am able to get it connected and display the information when I go to its IP address, I also have a LM335 Temperature monitor that is able to print all of the temperatures in Serial but I just don't know how to get it to print it on the webpage. Here is the code, can someone please help me get this to print on the webpage.
/*
* Web Server
*
* A simple web server example using the WiShield 1.0
*/
#include <WiShield.h>
#include <WiServer.h>
#include <SPI.h>
#define WIRELESS_MODE_INFRA 1
#define WIRELESS_MODE_ADHOC 2
// Wireless configuration parameters ----------------------------------------
unsigned char local_ip[] = {192,168,1,102}; // IP address of WiShield
//byte mac[] = { E0:91:F5:09:84:5A };
unsigned char gateway_ip[] = {192,168,1,1}; // router or gateway IP address
unsigned char subnet_mask[] = {255,255,255,0}; // subnet mask for the local network
const prog_char ssid[] PROGMEM = {"SmartHome"}; // max 32 bytes
unsigned char security_type = 0; // 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2
// WPA/WPA2 passphrase
const prog_char security_passphrase[] PROGMEM = {"DeadBeef"}; // max 64 characters
// WEP 128-bit keys
// sample HEX keys
prog_uchar wep_keys[] PROGMEM = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, // Key 0
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 1
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 2
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Key 3
};
// setup the wireless mode
// infrastructure - connect to AP
// adhoc - connect to another WiFi device
unsigned char wireless_mode = WIRELESS_MODE_INFRA;
unsigned char ssid_len;
unsigned char security_passphrase_len;
//---------------------------------------------------------------------------
float temp_in_celsius = 0;
float temp_in_kelvin=0;
float temp_in_fahrenheit=0;
// This is the webpage that is served up by the webserver
const prog_char webpage[] PROGMEM = {"HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<center><h1>Hello World!! I am WiShield</h1><form method=\"get\" action=\"0\">Toggle LED:<input type=\"submit\" name=\"0\" value=\"LED1\"></input></form></center>"};
// This is our page serving function that generates web pages7
void setup() {
WiFi.init();
}
void loop(){
WiFi.run();
//Reads the input and converts it to Kelvin degrees
temp_in_kelvin = analogRead(0) * 0.004882812 * 100;
//Converts Kelvin to Celsius minus 2.5 degrees error
temp_in_celsius = temp_in_kelvin - 2.5 - 273.15;
temp_in_fahrenheit = ((temp_in_kelvin - 2.5) * 9 / 5) - 459.67;
//Print the temperature in Celsius to the serial port
Serial.print("Celsius: ");
Serial.println(temp_in_celsius);
//Print the temperature in Fahrenheit to the serial port
Serial.print("Fahrenheit: ");
Serial.println(temp_in_fahrenheit);
Serial.print("Kelvin: ");
Serial.println(temp_in_kelvin);
Serial.println();
delay(1000);
}