Im using a Arduino Micro.
Here is the code:
#include <SCServo.h>
#include <SingleWireSerial.h>
SCSCL sc;
SingleWireSerial ServoSerial(false);
void setup(){
ServoSerial.begin(1000000);
sc.pSerial = &ServoSerial;
while(!ServoSerial) {}
}
void loop() {
sc.WritePos(1, 900, 0, 1500);
delay(5000);
sc.WritePos(1, 0, 0, 1500);
}
However, it complains about following:
error: cannot convert 'SingleWireSerial*' to 'HardwareSerial*' in assignment
sc.pSerial = &ServoSerial;
^~~~~~~~~~~
exit status 1
Compilation error: cannot convert 'SingleWireSerial*' to 'HardwareSerial*' in assignment
What im doing wrong?
I have tried connecting the SC15 to the hardware serial port, by short circuiting TX and RX, and then connecting the whole thing to the SC15 servo, but it seems that the SC servo library doesn't like the "echo garbage" that comes into the RX port when transmitting on TX, so I can use the servo, but not read any positions or similiar.
Can I somehow configure the hardware serial port to "swallow" the garbage on RX when TX'ing?
So im now trying to use SingleWireSerial to communicate with the servo (as its half duplex) but it doesn't work. What do I need to do?