This repository was archived by the owner on Feb 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
This repository was archived by the owner on Feb 28, 2024. It is now read-only.
GPIO pins go high on startup #72
Copy link
Copy link
Closed
Labels
conclusion: resolvedIssue was resolvedIssue was resolvedtopic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project
Description
Dear all
The GPIO pins seem to go high on startup when calling digital_programmables.init(). I have fixed it by setting the Pin to off before setting the pinMode.
Line 86 of ArduinoIOExpander.cpp looks now like this. Everything seems to work as intended
void ArduinoIOExpanderClass::initPins()
{
if (_tca.getAddress() == IO_ADD) {
PinStatus status = SWITCH_OFF;
set(IO_WRITE_CH_PIN_00, status);
set(IO_WRITE_CH_PIN_01, status);
set(IO_WRITE_CH_PIN_02, status);
set(IO_WRITE_CH_PIN_03, status);
set(IO_WRITE_CH_PIN_04, status);
set(IO_WRITE_CH_PIN_05, status);
set(IO_WRITE_CH_PIN_06, status);
set(IO_WRITE_CH_PIN_07, status);
set(IO_WRITE_CH_PIN_08, status);
set(IO_WRITE_CH_PIN_09, status);
set(IO_WRITE_CH_PIN_10, status);
set(IO_WRITE_CH_PIN_11, status);
pinMode(IO_WRITE_CH_PIN_00, OUTPUT);
pinMode(IO_WRITE_CH_PIN_01, OUTPUT);
pinMode(IO_WRITE_CH_PIN_02, OUTPUT);
pinMode(IO_WRITE_CH_PIN_03, OUTPUT);
pinMode(IO_WRITE_CH_PIN_04, OUTPUT);
pinMode(IO_WRITE_CH_PIN_05, OUTPUT);
pinMode(IO_WRITE_CH_PIN_06, OUTPUT);
pinMode(IO_WRITE_CH_PIN_07, OUTPUT);
pinMode(IO_WRITE_CH_PIN_08, OUTPUT);
pinMode(IO_WRITE_CH_PIN_09, OUTPUT);
pinMode(IO_WRITE_CH_PIN_10, OUTPUT);
pinMode(IO_WRITE_CH_PIN_11, OUTPUT);
pinMode(IO_READ_CH_PIN_00, INPUT);
pinMode(IO_READ_CH_PIN_01, INPUT);
pinMode(IO_READ_CH_PIN_02, INPUT);
pinMode(IO_READ_CH_PIN_03, INPUT);
pinMode(IO_READ_CH_PIN_04, INPUT);
pinMode(IO_READ_CH_PIN_05, INPUT);
pinMode(IO_READ_CH_PIN_06, INPUT);
pinMode(IO_READ_CH_PIN_07, INPUT);
pinMode(IO_READ_CH_PIN_08, INPUT);
pinMode(IO_READ_CH_PIN_09, INPUT);
pinMode(IO_READ_CH_PIN_10, INPUT);
pinMode(IO_READ_CH_PIN_11, INPUT);
} else {
pinMode(DIN_READ_CH_PIN_00, INPUT);
pinMode(DIN_READ_CH_PIN_01, INPUT);
pinMode(DIN_READ_CH_PIN_02, INPUT);
pinMode(DIN_READ_CH_PIN_03, INPUT);
pinMode(DIN_READ_CH_PIN_04, INPUT);
pinMode(DIN_READ_CH_PIN_05, INPUT);
pinMode(DIN_READ_CH_PIN_06, INPUT);
pinMode(DIN_READ_CH_PIN_07, INPUT);
}
}
So far I have not observed any unwanted effects from this change
Metadata
Metadata
Assignees
Labels
conclusion: resolvedIssue was resolvedIssue was resolvedtopic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project