From 47f2f26a4a131c5eae80a11f617d550e887ed850 Mon Sep 17 00:00:00 2001 From: Jakob Stendahl Date: Sat, 26 May 2018 12:38:50 +0200 Subject: IDNOTKNOW --- IOT-clapSensor.ino | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'IOT-clapSensor.ino') 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++) { -- cgit v1.2.3