I2C expandér PCF8574

Odpovědět
Le-Ze
Příspěvky: 84
Registrován: 31 kvě 2017, 15:37

I2C expandér PCF8574

Příspěvek od Le-Ze »

Poradí někdo jak na to?
https://github.com/skywodd/pcf8574_ardu ... /PCF8574.h
/**
* Read the state of all pins in one go
*
* @return The current value of all pins (1 bit = 1 pin, '1' = HIGH, '0' = LOW)
*/
uint8_t read();
Když takto jeden byte value = expander.digitalRead(0);
tomasp
Příspěvky: 55
Registrován: 15 dub 2014, 23:01

Re: I2C expandér PCF8574

Příspěvek od tomasp »

Na uvedeném githubu je i adresář s příkladem https://github.com/skywodd/pcf8574_ardu ... nBlink.ino, kde se píše
This demo code demonstrate all functionnalities of the PCF8574 library.
.
A ke konci příkladu je řádka

Kód: Vybrat vše

Serial.println(expander.read(), DEC); // Read the whole pins input register
Tom
Le-Ze
Příspěvky: 84
Registrován: 31 kvě 2017, 15:37

Re: I2C expandér PCF8574

Příspěvek od Le-Ze »

Tak ten přiklad je i ve stažene knihovně a ja na něj čučel :lol:
Hold slepejš :D
String x = String(expander.read(), DEC);
Odpovědět