Page 013 What next Servos - johnmholmes/Arduino-CBUS--Introduction-Series GitHub Wiki

Page updated 14/10/24

Now we have the input and out sketches working well and documented. I want to work on servo control as this to me is the final piece in the jigsaw. It will give me something to test CBUS on my Arduino based layout, but still have parts of it controlled with CMRI as well.

My initial approach was to use one of the examples found in the Arduino IDE library called MergCBUS as this had a simple example which was my starting point.

merg_servos example Sketch

This had to be altered to use with my Arduino Nano and MCP2515 module. This example was very interesting as I was able to get the servo to respond within the FCU, but then found an number of issues I would need to address to move forward.

  • merg_servo_v1 is in the example folder for reference only at this stage.
  • The first was understanding how to use the FCU to configure the module.
  • I was only able to control 2 servos for some reason, while this would not be an issue for my layout the sketch suggested more could be done.
  • The sketch mentioned it was possible to alter the speed of the servo using VarSpeedServo library by setting a node variable, this was not the case as the sketch had been setup with a fixed speed.
  • The trial came to an end once I realised the sketch was not setup to save the changes to the EEProm, which meant every time the unit was powered down it lost the saved open and closed positions of the servo.

I reached out to the sketch creators, and have received some advise on some changes. A known working example was supplied which will need to be tested out in the near future.

simpleservo example Sketch

This sketch has not been tested by me yet and may get altered after the 15 October 2024 when I get a chance to try it out.