change bank address
This commit is contained in:
parent
81434a39b5
commit
81f0e80f8c
3 changed files with 14 additions and 7 deletions
|
@ -5,7 +5,7 @@ uint8_t inputBufferB;
|
|||
|
||||
PCF8574 inputBankA(INPUT_BANK_A_ADDRESS);
|
||||
PCF8574 inputBankB(INPUT_BANK_B_ADDRESS);
|
||||
Adafruit_PWMServoDriver pwmBank = Adafruit_PWMServoDriver(0x5F);
|
||||
Adafruit_PWMServoDriver pwmBank = Adafruit_PWMServoDriver(PWM_BANK_ADDRESS);
|
||||
|
||||
void ESPMega_begin()
|
||||
{
|
||||
|
@ -15,7 +15,13 @@ void ESPMega_begin()
|
|||
inputBankB.begin();
|
||||
pwmBank.begin();
|
||||
|
||||
// ESPMegaPRO v3 use the PWMBank to drive Half Bridge
|
||||
// Push Pull Output is required.
|
||||
pwmBank.setOutputMode(true);
|
||||
|
||||
#ifdef USE_INTERRUPT
|
||||
pinMode(INPUT_BANK_A_INTERRUPT, INPUT_PULLUP);
|
||||
pinMode(INPUT_BANK_B_INTERRUPT, INPUT_PULLUP);
|
||||
attachInterrupt(digitalPinToInterrupt(INPUT_BANK_A_INTERRUPT),refreshInputBankA,FALLING);
|
||||
attachInterrupt(digitalPinToInterrupt(INPUT_BANK_B_INTERRUPT),refreshInputBankB,FALLING);
|
||||
#endif
|
||||
|
|
|
@ -7,13 +7,14 @@
|
|||
#include <PCF8574.h>
|
||||
|
||||
#define INPUT_BANK_A_ADDRESS 0x21
|
||||
#define INPUT_BANK_B_ADDRESS 0x20
|
||||
#define INPUT_BANK_B_ADDRESS 0x22
|
||||
#define PWM_BANK_ADDRESS 0x5F
|
||||
#define OUTPUT_BANK_ADDRESS 0x21
|
||||
#define EEPROM_ADDRESS 0x22
|
||||
|
||||
//#define USE_INTERRUPT
|
||||
//#define INPUT_BANK_A_INTERRUPT 35
|
||||
//#define INPUT_BANK_B_INTERRUPT 39
|
||||
#define INPUT_BANK_A_INTERRUPT 36
|
||||
#define INPUT_BANK_B_INTERRUPT 39
|
||||
|
||||
/**
|
||||
* Initiate ESPMega PRO Internal Components
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue