mcp23s17 ansprechbar

This commit is contained in:
Tristan Krause 2019-03-25 13:42:32 +01:00
parent 08795e7547
commit d3afcc2f37
7 changed files with 114 additions and 46 deletions

View file

@ -9,12 +9,11 @@ MCP23S17 beba0(spi, SPIADR::BEBA0);
int main() {
spi.init();
beba0.setDirA(0x00); // alle Ausgang
beba0.setDirB(0xFF); // alle Eingang
while(1) {
SPDR = 8;
while(!(SPSR & _BV(SPIF)));
//spi.pushByte(8);
beba0.writePortA(beba0.readPortB());
}
return 0;