mirror of
https://github.com/usatiuk/EggbotWireless.git
synced 2025-10-26 16:57:48 +01:00
status now always reports position
This commit is contained in:
17
Firmware/common/Util.h
Normal file
17
Firmware/common/Util.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef UTIL_H
|
||||
#define UTIL_H
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
constexpr int i2cFloatSize{4};
|
||||
|
||||
inline void bytesToFloat(float *target, byte *val) {
|
||||
memcpy(target, val, i2cFloatSize);
|
||||
return;
|
||||
}
|
||||
|
||||
inline void floatToBytes(byte *target, float val) {
|
||||
memcpy(target, &val, i2cFloatSize);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user