Skip to content

Commit

Permalink
Update SensorWebServerWithCSSandJS.ino
Browse files Browse the repository at this point in the history
  • Loading branch information
tigoe committed Jul 29, 2024
1 parent 37d6aa7 commit 3a101b3
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@
by Tom Igoe
*/

// include the sensor libraries:
// include the sensor libraries and the WiFI library:
#include "Adafruit_MCP9808.h"
#include "DHT.h"

// Digital pin that the DHT sensor is connected to:
#include <SPI.h>
// this is the Nano 33 IoT library. Change to match your board:
#include <WiFiNINA.h>
// include the WiFi network SSID and password:
#include "arduino_secrets.h"
Expand Down Expand Up @@ -51,8 +49,10 @@ void setup() {
}
// When you're connected, print out the device's network status:
IPAddress ip = WiFi.localIP();
if (Serial) Serial.print("IP Address: ");
if (Serial) Serial.println(ip);
if (Serial) {
Serial.print("IP Address: ");
Serial.println(ip);
}
// start the server:
server.begin();
// start the MCP sensor:
Expand Down Expand Up @@ -86,7 +86,7 @@ void loop() {
// if you only get a return character, then you've reached the end
// of the request. You can send a response:
if (input == "\r") {
Serial.println("request finished");
if (Serial) Serial.println("request finished");
// send a standard HTTP response header
client.println("HTTP/1.1 200 OK");
// set the content type (HTML, CSS, or JS):
Expand Down

0 comments on commit 3a101b3

Please sign in to comment.