Go Down

Topic: Help with programming a motor controller (Read 1 time) previous topic - next topic

Solution has been found for anyone else that encounters the same problem.

Code: [Select]

void setup()
{
Serial.begin(9600);
digitalWrite(3,HIGH);
pinMode(3,OUTPUT);
delay(10); // gives the motor controller plenty of time to start up
}

void loop()
{
//Four byte motor controller command
Serial.write(10000000); //Start byte
Serial.write((byte)0); //Device type
Serial.write(00000101);// Motor number and direction 
Serial.write(01111111);//Motor speed 0-127
}

PaulS

Quote
Solution has been found for anyone else that encounters the same problem.

I find that a little hard to believe. The documentation describes binary values for the command byte. That is NOT a binary value you are passing for the command byte. The 3rd and 4th are octal values. Why you chose base 8 when the documentation uses binary (base 2) needs explaining.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy