28 lines
519 B
C++
28 lines
519 B
C++
#include <Wire.h>
|
|
#include <XBee.h>
|
|
#include "protocol.h"
|
|
#include <LiquidCrystal_I2C.h>
|
|
|
|
// Peripherals
|
|
LiquidCrystal_I2C screen(0x27, 16, 2);
|
|
XBee xbee = XBee();
|
|
|
|
// ACTUAL DATA
|
|
uint8_t wave_id = 255; // last wave
|
|
uint8_t dist = 255; // actual distance
|
|
struct discover dsc = {0,0,0};
|
|
struct message msg = {1, dist, 0, 0, {}};
|
|
|
|
void setup() {
|
|
Serial.begin(38400);
|
|
Serial.println("+ ready");
|
|
|
|
screen.begin();
|
|
screen.backlight();
|
|
|
|
xbee.setSerial(Serial1);
|
|
Serial1.begin(38400);
|
|
}
|
|
|
|
void loop() {}
|