From c44fb0ac44a5ffa90db7b3a45bce29afdd9fe21b Mon Sep 17 00:00:00 2001 From: peteGSX Date: Thu, 22 Dec 2022 07:22:04 +1000 Subject: [PATCH] Disable device driver version, add myHal example --- IO_EXIOExpander.h | 3 +-- IO_EXIOExpander_version.h | 10 ---------- myEX-IOExpander.example.h | 22 ---------------------- myHal.cpp_example.txt | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 36 insertions(+), 34 deletions(-) delete mode 100644 IO_EXIOExpander_version.h delete mode 100644 myEX-IOExpander.example.h diff --git a/IO_EXIOExpander.h b/IO_EXIOExpander.h index fc5bc4b..6eb3492 100644 --- a/IO_EXIOExpander.h +++ b/IO_EXIOExpander.h @@ -48,7 +48,6 @@ #include "DIAG.h" #include "FSH.h" #include "EX-IOExpanderPins.h" -#include "IO_EXIOExpander_version.h" // Include user defined pin maps in myEX-IOExpander if defined #if __has_include ("myEX-IOExpander.h") @@ -141,7 +140,7 @@ private: void _display() override { DIAG(F("EX-IOExpander I2C:x%x Configured on Vpins:%d-%d %S"), _i2cAddress, _firstVpin, _firstVpin+_nPins-1, _deviceState == DEVSTATE_FAILED ? F("OFFLINE") : F("")); - DIAG(F("EX-IOExpander x%x using driver version %S"), _i2cAddress, EXIO_VERSION); + // DIAG(F("EX-IOExpander x%x using driver version %S"), _i2cAddress, EXIO_VERSION); DIAG(F("EX-IOExpander x%x: Digital Vpins %d-%d, Analogue Vpins %d-%d"), _i2cAddress, _firstVpin, _firstVpin + _numDigitalPins - 1, _firstVpin + _numDigitalPins, _firstVpin + _nPins - 1); diff --git a/IO_EXIOExpander_version.h b/IO_EXIOExpander_version.h deleted file mode 100644 index 6d2e553..0000000 --- a/IO_EXIOExpander_version.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef IO_EXIOEXPANDER_VERSION_H -#define IO_EXIOEXPANDER_VERSION_H - -#include "StringFormatter.h" - - -#define EXIO_VERSION "0.0.1alpha" -// 0.0.1 Initial version for alpha testing - -#endif \ No newline at end of file diff --git a/myEX-IOExpander.example.h b/myEX-IOExpander.example.h deleted file mode 100644 index 94e378e..0000000 --- a/myEX-IOExpander.example.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * © 2022 Peter Cole. All rights reserved. - * - * This is the example configuration file for a custom EX-IOExpander pin map file. - * - * It is highly recommended to copy this to "myEX-IOExpander.h" and modify to suit your specific - * requirements. - * - * If you are simply using a default definition for a defined microcontroller, then you don't - * need to use this file, and instead can use one of the existing definitions. - * - * Refer to https://dcc-ex.com for the full documentation. - * - * NOTE: Modifications to this file will be overwritten by future software updates. - */ -#ifndef MYEX_IOEXPANDER_H -#define MYEX_IOEXPANDER_H - -#define MY_NANO_DIGITAL_PINMAP 2,3,4,5,6,7,8,9,10,11,12,13 -#define MY_NANO_ANALOGUE_PINMAP A0,A1,A2,A3 - -#endif \ No newline at end of file diff --git a/myHal.cpp_example.txt b/myHal.cpp_example.txt index 32aa12e..3febc82 100644 --- a/myHal.cpp_example.txt +++ b/myHal.cpp_example.txt @@ -20,6 +20,8 @@ #include "IO_HCSR04.h" // Ultrasonic range sensor #include "IO_VL53L0X.h" // Laser time-of-flight sensor #include "IO_DFPlayer.h" // MP3 sound player +//#include "IO_EXTurntable.h" // Turntable-EX turntable controller +// #include "IO_EXIOExpander.h" // EX-IOExpander device driver //========================================================================== @@ -160,6 +162,39 @@ void halSetup() { // DFPlayer::create(10000, 10, Serial1); + //======================================================================= + // The following directive defines an EX-Turntable turntable instance. + //======================================================================= + // EXTurntable::create(VPIN, Number of VPINs, I2C Address) + // + // The parameters are: + // VPIN=600 + // Number of VPINs=1 (Note there is no reason to change this) + // I2C address=0x60 + // + // Note that the I2C address is defined in the EX-Turntable code, and 0x60 is the default. + + //EXTurntable::create(600, 1, 0x60); + + + //======================================================================= + // The following directive defines an EX-IOExpander instance. + //======================================================================= + // EXIOExpander::create(VPIN, Number of VPINs, I2C Address, Digital pin count, Analogue pin count) + // + // The parameters are: + // VPIN=an available Vpin + // Number of VPINs=Digital pin count + Analogue pin count (must match device in use as per documentation) + // I2C address=an available I2C address (default 0x65) + // + // Note that the I2C address is defined in the EX-IOExpander code, and 0x65 is the default. + // The first example is for an Arduino Nano with the default pin allocations. + // The second example is for an Arduino Uno using all pins as digital only. + + //EXIOExpander::create(800, 18, 0x65, EXIO_NANO_DIGITAL_PINS, EXIO_NANO_ANALOGUE_PINS); + //EXIOExpander::create(820, 16, 0x66, 16, 0); + + } #endif