Ramp Door operatorI have now finished the code to operate the ramp on my Calmac Ferry. At the moment it uses the non-centring channel so that I can stop the ramp before the ferry arrives at the slipway, and then complete the movement to drop the flap when the ramp is grounded. The servo is driven through an Action Servo Morph.
My new code will automatically lower the ramp only just by moving the control off the endpoint. Further movement will drop the flap. The code also slows the movement.
The development was done using a Servo Tester and a random value for the midway stop, so the next step is to hook up to the receiver and servo to find the actual point (in degrees) and also work out the correct speed. I may also have to restrict the travel. Once that is done I will make up a system with a Nano.
I had lots of problems getting this to work, mainly understanding the operation of "If...else". I found that quite a lot of the literature on Arduino.cc has not been updated for the latest version of Arduino IDE. There are some very conflicting examples around. It wasn't helped either by finding that my servo tester would randomly output rubbish.
The next project is a servo tester. I know I can buy one for a couple of pounds, but that is the price of a Nano.
There are plenty of examples of code to move a servo by potentiometer or do a sweep. I want to try and combine them.
Barrie
The Ramp code is available should anyone be interested.