Good afternoon!
How to configure MCP23017 macro to act as an input? I would like to connect 3 push buttons to port A GPA0-GPA1-GPA2.
MCP23017 INPUT
-
- Posts: 28
- http://meble-kuchenne.info.pl
- Joined: Wed Sep 22, 2021 7:23 am
- Been thanked: 2 times
-
- Matrix Staff
- Posts: 1924
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 623 times
- Been thanked: 645 times
Re: MCP23017 INPUT
Hello.
What version of Flowcode are you using?
When starting a new topic, we recommend using either a 9 or 10 post icon when the post is specific to a version of Flowcode.
What version of Flowcode are you using?
When starting a new topic, we recommend using either a 9 or 10 post icon when the post is specific to a version of Flowcode.
Martin
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 503 times
- Been thanked: 686 times
Re: MCP23017 INPUT
Hello,
Just call the read function with the appropriate port index and mask and the data direction will be done for you.
Just call the read function with the appropriate port index and mask and the data direction will be done for you.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Re: MCP23017 INPUT
Hello
I use Flowcode v9. The output already works with the MCP23017, but the input does not. I want to use only certain inputs from the MCP ic, with a push button. If I press the button, the value of the corresponding variable should be 0 or 1. This is what I want to achieve.
I have attached pictures.
I use Flowcode v9. The output already works with the MCP23017, but the input does not. I want to use only certain inputs from the MCP ic, with a push button. If I press the button, the value of the corresponding variable should be 0 or 1. This is what I want to achieve.
I have attached pictures.
- Attachments
-
- SCHEMATIC.JPG (32.03 KiB) Viewed 3393 times
-
- MCP_IN.JPG (32.2 KiB) Viewed 3393 times
-
- DEBUG.JPG (34.52 KiB) Viewed 3393 times
Re: MCP23017 INPUT
more picture
- Attachments
-
- MCP_IN_CONFIG_3.JPG (35.81 KiB) Viewed 3393 times
-
- MCP_IN_CONFIG_2.JPG (37.2 KiB) Viewed 3393 times
-
- MCP_IN_CONFIG_1.JPG (35.56 KiB) Viewed 3393 times
-
- Matrix Staff
- Posts: 1924
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 623 times
- Been thanked: 645 times
Re: MCP23017 INPUT
Hello.
Does reading the port work?
Does reading the port work?
- Attachments
-
- MCP20317 port read demo.fcfx
- (9.54 KiB) Downloaded 519 times
Martin
Re: MCP23017 INPUT
Only "DF_PLAYER" works, "VOL_UP" and "VOL_DOWN" do not work. Also, the value of "VOL_DOWN" is constantly 1. (no button is pressed, the value of "VOL_DOWN" is still 1.) It does not respond to "VOL_UP".
- Attachments
-
- DUMA_CLOCK_PSA08_MCP_IN.fcfx
- (150.52 KiB) Downloaded 470 times
-
- Matrix Staff
- Posts: 1924
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 623 times
- Been thanked: 645 times
Re: MCP23017 INPUT
One thing I have noticed.
With you have got OR which is a bitwise OR operator.
Can you try with || which is a logical OR operator.
| is the pipe key which is usually on the same key as the backslash \
Have you measured the voltage directly on the MCP23017 input pins to check the hardware?
With
Code: Select all
VOL_UP = 1 OR VOL_DOWN = 1
Can you try with
Code: Select all
VOL_UP = 1 || VOL_DOWN = 1
| is the pipe key which is usually on the same key as the backslash \
Have you measured the voltage directly on the MCP23017 input pins to check the hardware?
Martin