Smart_Cube_Full_Code/LiquidCrystal.cpp
void  LiquidCrystal::_digitalWrite(uint8_t p, uint8_t d) {
  if (_i2cAddr != 255) {
    // an i2c command
    _i2c.digitalWrite(p, d);
  } else if (_SPIclock != 255) {
    if (d == HIGH)
      _SPIbuff |= (1 << p);
    else
      _SPIbuff &= ~(1 << p);

    digitalWrite(_SPIlatch, LOW);
    shiftOut(_SPIdata, _SPIclock, MSBFIRST,_SPIbuff);
    digitalWrite(_SPIlatch, HIGH);
  } else {
    // straightup IO
    digitalWrite(p, d);
  }
}
// little wrapper for i/o writes
little wrapper for i/o writes
little wrapper for i / o writes
void  LiquidCrystal::_digitalWrite(uint8_t p, uint8_t d) {
  if (_i2cAddr != 255) {
    _i2c.digitalWrite(p, d);
  } else if (_SPIclock != 255) {
    if (d == HIGH)
      _SPIbuff |= (1 << p);
    else
      _SPIbuff &= ~(1 << p);
    digitalWrite(_SPIlatch, LOW);
    shiftOut(_SPIdata, _SPIclock, MSBFIRST,_SPIbuff);
    digitalWrite(_SPIlatch, HIGH);
  } else {
    digitalWrite(p, d);
  }
}
void LiquidCrystal :: _digitalWrite ( uint8_t p , uint8_t d ) { if ( _i2cAddr != 255 ) { _i2c . digitalWrite ( p , d ) ; } else if ( _SPIclock != 255 ) { if ( d == HIGH ) _SPIbuff |= ( 1 << p ) ; else _SPIbuff &= ~ ( 1 << p ) ; digitalWrite ( _SPIlatch , LOW ) ; shiftOut ( _SPIdata , _SPIclock , MSBFIRST , _SPIbuff ) ; digitalWrite ( _SPIlatch , HIGH ) ; } else { digitalWrite ( p , d ) ; } }
little wrapper for i/o writes
little wrapper for i / o writes
// an i2c command // straightup IO