MCP23S17 | Arduino library for MCP23S17 IO Expanders
kandi X-RAY | MCP23S17 Summary
kandi X-RAY | MCP23S17 Summary
Arduino library for MCP23S17 IO Expanders.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of MCP23S17
MCP23S17 Key Features
MCP23S17 Examples and Code Snippets
Community Discussions
Trending Discussions on MCP23S17
QUESTION
I use a STM32 connected with SPI to a MCP23S17 16 bit I/O port expander.
I want to make all 16 I/0 pins as output and just making them all LOW or HIGH.
I used an oscilloscope to check is SPI transmit the signals right, and it does. The only thing is that on the I/O pins I get around 0.4V. Not 5V.
Sometimes I get a value of 1.4V but it goes away, weird thing...
Can somebody check my code and tell me where is my mistake? I am pretty sure I did the code wrong somewhere.
MCP23S17.h:
...ANSWER
Answered 2021-Jan-08 at 10:34The only thing is that on the I/O pins I get around 0.4V
This is likely because GPIOs are not initialized.
You also have a different problem to deal with.
QUESTION
I have a callback method being triggered on a GPIO pin that when fired calls for a read of a input devices register, however when called I get -
Traceback (most recent call last): File "/home/coder/Try2.py", line 35, in NewPins x = self.mcp.readGPIO() AttributeError: 'int' object has no attribute 'mcp'
If I enter-
a.mcp.readGPIO()
<- from python shell I get
ANSWER
Answered 2019-Jul-21 at 12:21Ok my dumb.... - the RPiGPIO library I'm using returns the GPIO channel number in the callback, hence the callback function requires two arguments and not one. I had thought I'd messed up my namespaces and so was trying to code around this when I encountered the error above - I'm a novice python programmer and didn't know where to look! That'll teach me to not to read the documentation thoroughly...
QUESTION
I need to use a struct (struct1), that was previously declared, inside a new struct (struct2). Also I want to initialize it, and use some of the members of struct1 to initialize other members of struct2.
Specifically, I want to set values for struct1 and use some of those values to define the sizes of other members of struct2
I tried what is shown in the code, but I don't get why it isn't working.
...ANSWER
Answered 2019-Jun-19 at 23:08You can't mix a typedef
with initializers — at least, not in C. You also can't have structure types where the size varies depending on the data in the structure — at least, not without using one (and only one) flexible array member (FAM), but your code attempts to use two variable arrays (so they can't be FAMs).
You need something more like:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install MCP23S17
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page