I am currently working on a project that requires many different motors to be powered by a raspberrypi. Common drivers like the L298N use two gpio pins to drive a single motor in a direction, the direction is specified by setting one of the two pin states to HIGH. I want to know if it's possible to only use one pin for this purpose, i.e. setting a gpio pin to HIGH equals pin1=HIGH and pin2=LOW and setting it to low equals pin1=LOW and pin2=HIGH.
-
1Ah, D-Flip Flop is your friend: en.wikipedia.org/wiki/Flip-flop_(electronics)#D_flip-flop– tlfong01Jul 5, 2020 at 1:15
-
So you want the motors to be running full speed ALL the time? You just want to select run clockwise or run counterclockwise.– joanJul 5, 2020 at 7:45
-
@joan yes i always want one of the pins to be high, would this chip do the thing I want? aliexpress.com/item/…– YesJul 5, 2020 at 9:30
-
Possibly. I'd be tempted to use a port expander such as the I2C MCP23017. You can hook up 8 for 128 extra GPIO so sidelining the problem. If you do go the 74HC route make sure you can connect the chip. A DIL package will just plug in to a breadboard. The linked chip would be hard to use unless you are very good at soldering.– joanJul 5, 2020 at 12:09
1 Answer
Use a MUX or logic gate and create a function that does two things while gpio reacts differently. This way you can do that.
-
1
-
@Yes You can use something like this. But I think there better chip-set Jul 17, 2020 at 9:24
-
-
@Yes if youy are leaving near China try Ali. Your nearest Store can be a place to search Jul 17, 2020 at 13:44