From e696efbddd2d17bb4d635aa529e9355dbf2c1029 Mon Sep 17 00:00:00 2001 From: Persephone Bubblegum-Holiday Date: Tue, 1 Jul 2025 19:10:42 -0700 Subject: [PATCH] small fix for 32 channel firmwares --- .../Firmware-32Valve-Mega.ino | 16 ++++++++++------ .../Firmware-Servo-HelenMitzi.ino | 16 ++++++++++------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/Arduino Firmware/Firmware-32Valve-Mega/Firmware-32Valve-Mega.ino b/Arduino Firmware/Firmware-32Valve-Mega/Firmware-32Valve-Mega.ino index 2dabcad..684d842 100644 --- a/Arduino Firmware/Firmware-32Valve-Mega/Firmware-32Valve-Mega.ino +++ b/Arduino Firmware/Firmware-32Valve-Mega/Firmware-32Valve-Mega.ino @@ -21,17 +21,21 @@ void loop() { byte1 = Serial.read(); byte2 = Serial.read(); - byte3 = Serial.read(); - byte4 = Serial.read(); - byte5 = Serial.read(); - byte6 = Serial.read(); - byte7 = Serial.read(); - byte8 = Serial.read(); + if ((byte1 & 32) && (byte2 & 32)) { if (byte1 & 1) Serial.write("PC3,32\n"); } + else + { + byte3 = Serial.read(); + byte4 = Serial.read(); + byte5 = Serial.read(); + byte6 = Serial.read(); + byte7 = Serial.read(); + byte8 = Serial.read(); + } if ((byte1 & 64) && (byte2 & 64) && (byte3 & 64) && (byte4 & 64) && (byte5 & 64) && (byte6 & 64) && (byte7 & 64) && (byte8 & 64)) { diff --git a/Arduino Firmware/Servo/Firmware-Servo-HelenMitzi/Firmware-Servo-HelenMitzi.ino b/Arduino Firmware/Servo/Firmware-Servo-HelenMitzi/Firmware-Servo-HelenMitzi.ino index dc07f62..1311e8d 100644 --- a/Arduino Firmware/Servo/Firmware-Servo-HelenMitzi/Firmware-Servo-HelenMitzi.ino +++ b/Arduino Firmware/Servo/Firmware-Servo-HelenMitzi/Firmware-Servo-HelenMitzi.ino @@ -36,18 +36,22 @@ void loop() { { byte1 = Serial.read(); byte2 = Serial.read(); - byte3 = Serial.read(); - byte4 = Serial.read(); - byte5 = Serial.read(); - byte6 = Serial.read(); - byte7 = Serial.read(); - byte8 = Serial.read(); if ((byte1 & 32) && (byte2 & 32)) { if (byte1 & 1) Serial.write("PC3,8\n"); } + else + { + byte3 = Serial.read(); + byte4 = Serial.read(); + byte5 = Serial.read(); + byte6 = Serial.read(); + byte7 = Serial.read(); + byte8 = Serial.read(); + } + if ((byte1 & 64) && (byte2 & 64) && (byte3 & 64) && (byte4 & 64) && (byte5 & 64)) { if (byte1 & 1) servoChannel[mapping[0]].write(onDegrees[0]);