sumotoy / gpio_expander

A library for drive a lot of GPIO chips with Arduino/Teensy3.x or LC
66 stars 29 forks source link

Pin assignments? #3

Open tonton81 opened 8 years ago

tonton81 commented 8 years ago

Good evening sumotoy, I'm testing the gpioDigitalRead on the MCP23S17 and getting the pins (not in order) and number squared.. pinconfig

i cant seem to figure it out, and im actually worried if i should attempt the digitalwrite commands hehe thanks tony

tonton81 commented 8 years ago

it doesnt go from 0 to 15 when i digital read, it's more like this when reading: digitalread pin 0 reads pin 8 digitalread pin 1 reads pin 9 digitalread pin 2 reads pin 10 digitalread pin 3 reads pin 11 digitalread pin 4 reads pin 12 digitalread pin 5 reads pin 13 digitalread pin 6 reads pin 14 digitalread pin 7 reads pin 15 digitalread pin 8 reads pin 0 digitalread pin 9 reads pin 1 digitalread pin 10 reads pin 2 digitalread pin 11 reads pin 3 digitalread pin 12 reads pin 4 digitalread pin 13 reads pin 5 digitalread pin 14 reads pin 6 digitalread pin 15 reads pin 7

and of course, the variable it reads. does this have something mixed in the library with MSB/LSB? Thanks Tony

tonton81 commented 8 years ago

oh possibly i have found the key, however i am still novice at remedying it, but the mcp23s* libraries seem to be using BYTE as it doesnt exist on the current IDE's :(, could this be the issue>? thanks

sumotoy commented 8 years ago

Seems a stupid error in MSB/LSB conversion, I will check monday.

plantlover commented 8 years ago

I'm experiencing the same with the PCA9555-based Funduino I2C to GPIO module.

kyranf commented 2 years ago

Was this ever fixed for the PCA9655? I have some issues which could be similar to this.