C++ -Bosch Motor - DIO Code - Help Please!

I’m relatively new to C++ coding, and our team would like to use the Bosch seat motors this year. I am able to program the motors to run for a set time, so that they only do quarter turns, but the flaw to this is that buttons can continue to be pressed so that the motors keep rotating. So, I’d like to use the DIO thingy to limit the rotation so that they only turn a quarter. Any ideas? I’d really appreciate some example code or ideas since VS Code doesn’t offer any sample code for me to base off of.


There’s a lot of good stuff on this on other threads:


The first thing to know is that the voltage variation in the Bosch tach output does not go low enough to ever show up as “low” on a DIO port; you will need an amplifier or trigger to gain it up. AndyMark sells these, and has the schematic available if it is out of stock.
After that, it’s pretty much like any other encoder, except it’s a single encoder, not a quadrature.

You could also use a “slip clutch” to attach your Bosch motor and not worry about the feedback. For an example, check out the Robotnauts 2019 build here: Everybot 2019 build