Hi all
I have used successfully the Flowcode rotary encoder component no problems
But has anyone generated a component or flowchart to to use an encoder / encoders via i2c MCP23017
I want to add up to 3 encoders via MCP23017 i think should be quite possible as MCP23017 has interrupt on change pins
David
rotary encoder via MCP23017
-
- Posts: 140
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 7:35 pm
- Been thanked: 18 times
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 503 times
- Been thanked: 686 times
Re: rotary encoder via MCP23017
Hi David,
Yes certainly should be possible, you would need to enable the interrupt on the MCP23017 device by writing to the registers that control the interrupt. Then connect the INT pin of the MCP23017 to a pin on your MCU and interrupt when the INT pin fires to collect the encoder pin states.
This is the macro code from the quad encoder component if you want to replicate with the MCP23017 pins.
Simply change pin_a and pin_b with pin states read from the MCP23017.
Yes certainly should be possible, you would need to enable the interrupt on the MCP23017 device by writing to the registers that control the interrupt. Then connect the INT pin of the MCP23017 to a pin on your MCU and interrupt when the INT pin fires to collect the encoder pin states.
This is the macro code from the quad encoder component if you want to replicate with the MCP23017 pins.
Simply change pin_a and pin_b with pin states read from the MCP23017.
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
-
- Posts: 140
- Joined: Wed Dec 02, 2020 7:35 pm
- Been thanked: 18 times
Re: rotary encoder via MCP23017
Thanks Ben
I will use your fcm as a basis when i get back to this in a couple of weeks time to generate a new fcm with this added functionality
Will also drop it into this forum so others can potentially use it if required
David
I will use your fcm as a basis when i get back to this in a couple of weeks time to generate a new fcm with this added functionality
Will also drop it into this forum so others can potentially use it if required
David