card installation checking
This commit is contained in:
parent
1862887d30
commit
1481c08d3a
10 changed files with 122 additions and 37 deletions
|
@ -15,9 +15,14 @@ DigitalOutputCard::DigitalOutputCard(bool bit0, bool bit1, bool bit2, bool bit3,
|
|||
|
||||
}
|
||||
// Initialize the card
|
||||
void DigitalOutputCard::begin() {
|
||||
bool DigitalOutputCard::begin() {
|
||||
this->pwm = Adafruit_PWMServoDriver(this->address);
|
||||
this->pwm.begin();
|
||||
this->pwm.begin();
|
||||
pwm.reset();
|
||||
pwm.setOutputMode(true);
|
||||
// Output card don't send ack, we can't check if it's connected
|
||||
// so we just return true
|
||||
return true;
|
||||
}
|
||||
// Set the output to the specified state
|
||||
void DigitalOutputCard::digitalWrite(uint8_t pin, bool state) {
|
||||
|
@ -29,4 +34,8 @@ void DigitalOutputCard::analogWrite(uint8_t pin, uint16_t value) {
|
|||
if (value > 4095) value = 4095;
|
||||
// Set the pwm value
|
||||
this->pwm.setPin(pin, value);
|
||||
}
|
||||
|
||||
// Dummy loop function
|
||||
void DigitalOutputCard::loop() {
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue