-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathESP32ServoServer.ino
49 lines (46 loc) · 1.2 KB
/
ESP32ServoServer.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "Arduino.h"
#include <ESP32Servo.h>
#include <SimplePacketComs.h>
#include <WiFi.h>
#include <PacketEvent.h>
#include <Esp32SimplePacketComs.h>
#include <Preferences.h>
#include <Esp32WifiManager.h>
#include <wifi/WifiManager.h>
#include <server/NameCheckerServer.h>
#include "src/ServoServer.h"
#include <Adafruit_Sensor.h>
#include <Adafruit_BNO055.h>
#include "src/GetIMU.h"
// SImple packet coms implementation useing WiFi
UDPSimplePacket coms;
// WIfi stack managment state machine
WifiManager manager;
//The setup function is called once at startup of the sketch
String * name = new String("kevkat");
Adafruit_BNO055 bno;
GetIMU * sensor;
void setup()
{
manager.setupScan();
sensor = new GetIMU();
Serial.println("Loading with name: "+name[0]);
//Initialise the sensor
if (bno.begin()) {
delay(1000);
bno.setExtCrystalUse(true);
sensor->startSensor(&bno);
}else{
Serial.print(
"Ooops, no BNO055 detected ... Check your wiring or I2C ADDR!");
}
coms.attach(new NameCheckerServer(name));
coms.attach(sensor);
coms.attach(new ServoServer());
}
// The loop function is called in an endless loop
void loop()
{
manager.loop();
coms.server();
}