vitotai / BrewManiacEsp8266

BrewManiac on ESP8266. Only ESP8266 needed.
158 stars 71 forks source link

Number of Pins to PCF8574 #44

Open gumazza opened 5 years ago

gumazza commented 5 years ago

I'm trying to set up P4 from PCF8574, but I can not figure out which number to use. I know that. P0-1 P1-2 P2-4 P3-8 P4 -? P5-32 P6 -? P7 -?

vitotai commented 5 years ago

2^n. A better way to do it is

define P0 1

define P1 (1>>1)

define P2 (1>>2)

...

define P7 (1>>7)