micropython-pcf8575 icon indicating copy to clipboard operation
micropython-pcf8575 copied to clipboard

pin write sets other pins to zero/low

Open somervda opened this issue 1 year ago • 2 comments

Thanks for the library

I noticed that when I was reading on some pins and writing on others that the write operation impacts the pins I want to read values from. Looks like to do reads, the pins need to have been set high (The default state of the pcf8575). However if I do a pin write i.e. pin(4,1) , then the other pins get set low (0) and I can no longer read values from them. I don't mind making a change to the logic to support doing reads and writes on the same pcf8575 device but not sure the best way to approach it .

  • One choice is to read the values of all the pins and set the one other than the pin I am writing to , to the same value.
  • Another option would be to define a mask of read pins and always set then high when doing a write .

somervda avatar Nov 15 '24 22:11 somervda

I'm running into the same issue here. Did you develop a fix or workaround? Thanks

TigeyJewellAlibhai avatar Jan 18 '25 04:01 TigeyJewellAlibhai

My main work around was to set the pin value high before reading it. In the end I didn't need to write out data for my project so didn't fix it.

somervda avatar Jan 21 '25 17:01 somervda