From f8b054cf6ab0dfa05451f4ee0e07c53d89a51942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Vigan=C3=B2?= Date: Mon, 27 Mar 2023 16:44:47 +0200 Subject: [PATCH] [ESP32] Use GPIO 35/A2 and 34/A3 for current sensing (#325) * [ESP32] Use GPIO 35/A2 and 34/A3 for current sensing while used in combination with the standard Motor Shield * Update version.h changelog --- MotorDrivers.h | 6 +++--- version.h | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/MotorDrivers.h b/MotorDrivers.h index c066052..cc13f54 100644 --- a/MotorDrivers.h +++ b/MotorDrivers.h @@ -73,12 +73,12 @@ #elif defined(ARDUINO_ARCH_ESP32) // STANDARD shield on an ESPDUINO-32 (ESP32 in Uno form factor). The shield must be eiter the // 3.3V compatible R3 version or it has to be modified to not supply more than 3.3V to the -// analog inputs. Here we use analog inputs A4 and A5 as A0 and A1 are wired in a way so that +// analog inputs. Here we use analog inputs A2 and A3 as A0 and A1 are wired in a way so that // they are not useable at the same time as WiFi (what a bummer). The numbers below are the // actual GPIO numbers. In comments the numbers the pins have on an Uno. #define STANDARD_MOTOR_SHIELD F("STANDARD_MOTOR_SHIELD"), \ - new MotorDriver(25/* 3*/, 19/*12*/, UNUSED_PIN, 13/*9*/, 36/*A4*/, 0.70, 1500, UNUSED_PIN), \ - new MotorDriver(23/*11*/, 18/*13*/, UNUSED_PIN, 12/*8*/, 39/*A5*/, 0.70, 1500, UNUSED_PIN) + new MotorDriver(25/* 3*/, 19/*12*/, UNUSED_PIN, 13/*9*/, 35/*A2*/, 0.70, 1500, UNUSED_PIN), \ + new MotorDriver(23/*11*/, 18/*13*/, UNUSED_PIN, 12/*8*/, 34/*A3*/, 0.70, 1500, UNUSED_PIN) #else // STANDARD shield on any Arduino Uno or Mega compatible with the original specification. diff --git a/version.h b/version.h index 47d82db..5cb5cea 100644 --- a/version.h +++ b/version.h @@ -8,12 +8,13 @@ // 4.2.37 - Add new FLAGS HAL device for communications to/from EX-RAIL; // - Fix diag display of high VPINs within IODevice class. // 4.2.36 - do not broadcast a turnout state that has not changed +// - Use A2/A3 for current sensing on ESP32 + Motor Shield // 4.2.35 - add direct pin manipulation command // 4.2.34 - Completely fix EX-IOExpander analogue inputs // 4.2.33 - Fix EX-IOExpander non-working analogue inputs // 4.2.32 - Fix LCD/Display bugfixes from 4.2.29 // 4.2.31 - Removes EXRAIL statup from top of file. (BREAKING CHANGE !!) -// Just add AUTOSTART to the top of your myAutomation.h to restore this function. +// Just add AUTOSTART to the top of your myAutomation.h to restore this function. // 4.2.30 - Fixes/enhancements to EX-IOExpander device driver. // 4.2.29 - Bugfix Scroll LCD without empty lines and consistent // 4.2.28 - Reinstate use of timer11 in STM32 - remove HA mode.