diff options
author | Jakob Stendahl <jakob.stendahl@outlook.com> | 2018-05-26 12:38:50 +0200 |
---|---|---|
committer | Jakob Stendahl <jakob.stendahl@outlook.com> | 2018-05-26 12:38:50 +0200 |
commit | 47f2f26a4a131c5eae80a11f617d550e887ed850 (patch) | |
tree | e6ebd05221ddb17ef65bd685474a3f89bf462db1 | |
parent | 796eea12f83420dd7d21bddb8bdb0de8438e3130 (diff) | |
download | Luxcena-cs-47f2f26a4a131c5eae80a11f617d550e887ed850.tar.gz Luxcena-cs-47f2f26a4a131c5eae80a11f617d550e887ed850.zip |
IDNOTKNOW
-rw-r--r-- | IOT-clapSensor.ino | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/IOT-clapSensor.ino b/IOT-clapSensor.ino index f9307bd..5fe29e1 100644 --- a/IOT-clapSensor.ino +++ b/IOT-clapSensor.ino @@ -45,6 +45,7 @@ int samplePeak = 0; int sensorthreshold = 600; int bufferKey[6] = {0, 0, 1, 0, 1, 0}; + ESP8266WebServer server ( 80 ); // webServer on port 80 void setup ( void ) { @@ -90,10 +91,10 @@ void setup ( void ) { // Setup pins and set default values pinMode ( lampPin, OUTPUT ); lampOn = false; // Vil at denne skal bli husket, altså være samme etter boot - sensorActive = true; + sensorActive = false; digitalWrite(lampPin, lampOn); - // Try to connect to WiFi + // Try to connect to WiFia WiFi.begin ( ssid, password ); // Wait for connection @@ -114,7 +115,7 @@ void setup ( void ) { Serial.println ( WiFi.localIP() ); } else { WiFi.disconnect(); - //WiFi.softAP(APssid); // add password here as second parameter, currently just a open hotspot + WiFi.softAP(APssid); // add password here as second parameter, currently just a open hotspot IPAddress myIP = WiFi.softAPIP(); Serial.print("APssid: "); Serial.println(APssid); @@ -202,6 +203,18 @@ void bufferAlgo() { } +void bufferAlgoLong() { + + bool foundPulse = false; + + for (int i = 0; i <= bufferSize; i++) { + if (soundBuffer[i] == 1) { + + } + } + +} + void dumpBuffer() { String output = ""; for (int i = 0; i <= bufferSize; i++) { |