|
|
@ -59,6 +59,7 @@ int lowFreqFilter(int inputValue, int lastFilteredValue, int alpha) { |
|
|
|
return (lastFilteredValue + alpha * (inputValue - lastFilteredValue)+100); |
|
|
|
} |
|
|
|
|
|
|
|
// TODO: необходимо перекомпоновать функцию updateAccelerometer()
|
|
|
|
void updateAccelerometer() |
|
|
|
{ |
|
|
|
if ((millis() - accelerometer.lastUpdate) > (1000 / graphAcc.graphUpdateRate)) |
|
|
@ -117,24 +118,6 @@ void sendAccelerometerData() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//** WEBSOCKET TEST **//
|
|
|
|
void webSocketEvent(uint8_t num, WStype_t type, uint8_t *payload, size_t length) |
|
|
|
{ |
|
|
|
switch (type) |
|
|
|
{ |
|
|
|
case WStype_DISCONNECTED: |
|
|
|
Serial.printf("[%u] Disconnected!\n", num); |
|
|
|
break; |
|
|
|
case WStype_CONNECTED: |
|
|
|
{ |
|
|
|
IPAddress ip = webSocket.remoteIP(num); |
|
|
|
Serial.println("Client connected!"); |
|
|
|
Serial.printf("[%u] Connected from %d.%d.%d.%d url: %s\n", num, ip[0], ip[1], ip[2], ip[3], payload); |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
//** WEBSOCKET TEST END**//
|
|
|
|
|
|
|
|
void setup(void) |
|
|
|
{ |
|
|
@ -158,11 +141,7 @@ void setup(void) |
|
|
|
server.begin(); |
|
|
|
Serial.println("HTTP server started"); |
|
|
|
|
|
|
|
//** WEBSOCKET TEST **//
|
|
|
|
|
|
|
|
webSocket.begin(); |
|
|
|
webSocket.onEvent(webSocketEvent); |
|
|
|
//** WEBSOCKET TEST END**//
|
|
|
|
} |
|
|
|
|
|
|
|
void loop(void) |
|
|
|