From ba0b19560f3fbd276a220b709b23937646eff385 Mon Sep 17 00:00:00 2001 From: Fisch Date: Mon, 28 Mar 2022 20:04:44 +0200 Subject: [PATCH] inital library setup --- README.md | 4 ++++ src/hoverboard-esc-serial-comm.cpp | 10 ++++++++++ src/hoverboard-esc-serial-comm.h | 19 +++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 README.md create mode 100644 src/hoverboard-esc-serial-comm.cpp create mode 100644 src/hoverboard-esc-serial-comm.h diff --git a/README.md b/README.md new file mode 100644 index 0000000..bb5721c --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# Library to control hoverboard-firmware-hack-foc-serial-esc + +When using https://gitea.ctdo.de/interfisch/hoverboard-firmware-hack-foc-serial-esc this library is used to send commands to the hoverboard PCB. + diff --git a/src/hoverboard-esc-serial-comm.cpp b/src/hoverboard-esc-serial-comm.cpp new file mode 100644 index 0000000..5d9ed73 --- /dev/null +++ b/src/hoverboard-esc-serial-comm.cpp @@ -0,0 +1,10 @@ +#include "hoverboard-esc-serial-comm.h" + +ESCSerialComm::ESCSerialComm() { //constructor + +} + +void ESCSerialComm::update(long millis, boolean state) //example function +{ + //Do stuff +} \ No newline at end of file diff --git a/src/hoverboard-esc-serial-comm.h b/src/hoverboard-esc-serial-comm.h new file mode 100644 index 0000000..0e3fdba --- /dev/null +++ b/src/hoverboard-esc-serial-comm.h @@ -0,0 +1,19 @@ +#ifndef ESCSERIALCOMM_H +#define ESCSERIALCOMM_H + +#include + +#define SERIAL_CONTROL_BAUD 115200 // [-] Baud rate for HoverSerial (used to communicate with the hoverboard) +#define SERIAL_BAUD 115200 // [-] Baud rate for built-in Serial (used for the Serial Monitor) +#define START_FRAME 0xABCD // [-] Start frme definition for reliable serial communication + + +class ESCSerialComm +{ + public: + ESCSerialComm(); //constructor + void update(long millis, boolean state); //declare example function + private: + long _millis_lastinput; //declare private variable +}; +#endif \ No newline at end of file