Skip to content
Snippets Groups Projects
Verified Commit 8d284d56 authored by Thomas Lambert's avatar Thomas Lambert :helicopter:
Browse files

fix(esc): add offset between two ESC

parent aa14eb3a
No related branches found
No related tags found
No related merge requests found
......@@ -75,6 +75,7 @@ const uint16_t gMAX_RPM = 3000; // Motor maximum RPM (set in ESC)
const uint16_t gMIN_RPM = 750; // Motor minimum RPM (set in ESC)
const uint8_t gMAX_ESC_VAL = 160; // Value at which motor is at max RPM
const uint8_t gMIN_ESC_VAL = 40; // Min value for ESC to start motor (trial-error)
const uint8_t gESC_OFFSET = 4; // Offset to add to ESC 2 to sync them
const uint8_t gCSN_PINS[] = CSN_PINS; // Encoder Chip Select pins
const int8_t gENC_ORIENT[] = ENC_ORIENT; // Encoder orientation
......@@ -172,7 +173,7 @@ void loop() {
// Write value to ESCs
gEsc1.write(gEsc_val);
gEsc2.write(gEsc_val);
gEsc2.write(gEsc_val + gESC_OFFSET);
// Read value from rotary encoders
for (int i = 0; i < sizeof(gCSN_PINS); i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment