Created
December 5, 2022 21:04
-
-
Save cathode/7295764e5085bff60d767c60b077731f to your computer and use it in GitHub Desktop.
C++ reference fail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Declaration in .ino | |
PinDef in_pins[__INPUTS_COUNT]; | |
PinDef out_pins[__OUTPUTS_COUNT]; | |
Bounce2::Button db_inputs[__INPUTS_COUNT]; | |
// call: | |
press->configureInputs( | |
db_inputs[LIMIT_STROKE_UP], | |
db_inputs[LIMIT_STROKE_DOWN]); | |
// class / function: | |
// .h | |
class PressActuator : public SubsystemBase | |
{ | |
private: | |
Bounce2::Button *_limitSwUp; | |
Bounce2::Button *_limitSwDown; | |
public: | |
void configureInputs(Bounce2::Button &limitSwUp, Bounce2::Button &limitSwDown); | |
}; | |
// .cpp | |
void PressActuator::configureInputs(Bounce2::Button& limitSwUp, Bounce2::Button& limitSwDown) | |
{ | |
this->_limitSwUp = &limitSwUp; | |
this->_limitSwDown = &limitSwDown; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment