Hey,
I've just bought a SyRen 25 motor controller and I own an Axon.
I've been using this page as documentation for the SyRen 25 :
http://www.dimensionengineering.com/datasheets/SyRen10-25.pdfI'm using the SyRen 25 in simple serial mode with braud rate 38400. I'm using the UART2 pins on the Axon and have connected the T-pin to the SyRen's S1 pin and the Axon's G-pin to the SyRen's 0V pin. At the other end, I have the motor connected to the M1 and M2 pins and a battery connected to the B+ and B- pins. The Axon also has a battery connected to it.
My problem is that I'm confused about how to send messages to the motor controller in my code. I found the admin's little method for the controler : syren(int m1) and have been using that. However, how should this be used?
My control.m file currently looks like this :
void control(void) {
//Deal with user commands (currently only through the hardware button)
while(button_pressed()) {
LED_on();
delay_ms(1000)
syren(255);
delay_ms(10000);
syren(0);
delay_ms(500);
LED_off();
}
}
I was expecting this to make the motor run forward for 10 seconds then stop. But this makes the motor move slightly in one direction and stops then moves slightly in other direction. This suggests that the SyRen needs to be constantly sent the command to keep it running at the required speed. So I changed my code to this
void control(void) {
//Deal with user commands (currently only through the hardware button)
while(button_pressed()) {
syren(255);
}
}
Which I expect to mean that the motor will only run when the button is pressed. However the motor is off until i press the button, it then stays on until i remove power from the Axon. Also when i remove the power from the Axon (but not the SyRen) the motor
So where am i going wrong and which is the right way to use it?
Thanks