Right now I am currently working on my frustrating-to-work-on robot and I wanted to make a toggle system in which you press a button once and the intake rollers move at an optional speed in a certain direction and you press another button (or the same button if possible) and it goes the other direction with another optional speed. I would also like to know if there is a way to cancel the toggle.
I am using ROBOTC. (yes i know it shows in the category)
Can somebody help me with this?
I have two motors for each side of the intake rollers, and they are hooked onto port 9 and 7.
If this is basically not possible, please tell me. I already have an idea in mind for what I can do.
As I was writing a reply about a problem, I realized something that was simple yet fixed the problem. I finally got the toggle system working! I think I can duplicate the code and set the direction to go differently when another button is pressed now. Thanks!
…and for those wonder how my code looks, here it is from a testing file: