restructured project
This commit is contained in:
parent
87fd0f35f6
commit
7515726a8f
14 changed files with 5 additions and 1 deletions
28
firmware/src/main.cpp
Normal file
28
firmware/src/main.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#include <Arduino.h>
|
||||
#include <sensors/BmpSensor.h>
|
||||
#include <ble/BluetoothServer.h>
|
||||
|
||||
#define SLEEP_TIME 2
|
||||
#define BAUD_RATE 112500
|
||||
#define INTERNAL_LED_PIN 2
|
||||
|
||||
|
||||
Sensor *bmpSensor;
|
||||
BluetoothServer *server;
|
||||
|
||||
void setup() {
|
||||
Serial.begin(BAUD_RATE);
|
||||
pinMode(INTERNAL_LED_PIN, OUTPUT);
|
||||
|
||||
bmpSensor = new BmpSensor();
|
||||
|
||||
server = new BluetoothServer();
|
||||
server->startServer();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
sensor_data_t sample = ((BmpSensor *) bmpSensor)->sampleLowEnergy();
|
||||
server->setPressure(sample.pressure);
|
||||
server->setTemperature(sample.temperature);
|
||||
delay(SLEEP_TIME * 1000);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue