Controlling a servo on pin D10 from cockpit


Im trying to connect a servo on pin D10 as that is the only left available. I’d like to control the servo from cockpit using letters on the keyboard not used for anything else. I am working with the V2.8 and the lastest firmware.

Any advice on how I can do this?


In more basic terms, id like to replicate the functionality of pin D11 in pin D10

Code for the Servos

The quick and dirty way if you are familiar with using Cloud9/general coding, would be to duplicate the existing AltServo code for the arduino and cockpit:

The files that are of interest on the arduino side are:

  • /openrov/arduino/CAltServo.cpp
  • /openrov/arduino/Aconfig.h
  • /openrov/arduino/SystemConstants.cpp

On the cockpit side, create a copy of the /cockpit/src/lib/plugins/altservo/ and modify:

  • /cockpit/src/lib/plugins/altservo2/index.js
  • /cockpit/src/lib/plugins/altservo2/public/js/altservo.js

Basically you can then just change references like AltServo, asrt, alts, etc (to AltServo2, asr2t, alts2 etc), reload the cockpit and update the firmware and you should be good to go.

P.S. If none of the above makes any sense to you, let me know and I can probably put something together for you.