I would like to order a DC engine based on:
- different speeds depending on the incline (0 to 10 degrees nothing, 10 to 40 128 and 40 value 255) and reverse to reduce engine speed
- speed and gradual deceleration of the engine
and the most would be to combine with the speed of the gyroscope if movement - we advance according to the speed of the angle, if negative movement we slow down and if no movement is the engine shutdown.
I've done several program tests but I can't find the right technique.
Please, could you help me?
some sample code could be nice