We are building a robot and I have a question about the programming logic.
I want the program to do the following: 1. move the robot forward until having contact with the reed A (giving me a digital 1 if hit, but only while having contact) 2. then I want to move it backward until having contact with reed B 3. And then finally I want it to move forward again for a defined time.
I have defined the following functions for the motor. motorAn(); //motor on motorVor(); //move forward motorBremse(); //break motorRueck(); //move backward motorAus(); //motor off
However, I am struggeling with the programming logic of how I can make it move the way I want to.
I'd be really thankful if someone could help me with my problem :-)