Buy an Axon, Axon II, or Axon Mote and build a great robot, while helping to support SoR.
0 Members and 1 Guest are viewing this topic.
void scan(void) { int i=0; int j=5000; long int wheel_left=500; for(i=0;i<j*500;i++) { wheel_left=850; } for(i=j*500;i>j*499;i--) { wheel_left=500; } wheel_left(wheel_left); delay_ms(20); }
Any input or ideas as to what might be wrong with my code?
void scan(void) { long int i=0; long int wheel_left=500; for(i=0;i<65535;i++) { wheel_left=850; } for(i=65535;i>65535;i--) { wheel_left=500; } wheel_left(wheel_left); delay_ms(20); }
for(i=65535;i>65535;i--)
for(i=65535;i>0;i--)
Code: [Select]for(i=65535;i>65535;i--)should beCode: [Select]for(i=65535;i>0;i--)
QuoteAny input or ideas as to what might be wrong with my code?first, this is impossible:int j=5000;int only goes to 255 . . . make it a long int . . .same for i
I think the problem is that you update the servo position at the end of the scanning loops. You must update it inside the loop.Can you post the code you are running now ? I'm a bit lost with your modification
wheel_left(850);
servo(PORTE,6,850);
rprintf("Servo_Position=%d%d\r\n", wheel_left);
All It shows is "System Warming up" and "Initialization Complete" which is odd since I only modded it a bit from what I was using in a previous test...
Admin, what type of code did you use for those ERP and movement demos where only the arms would move and such? I just wanna see a sample so I can tell maybe what I'm doing wrong.
void scan2(void) { long unsigned int i=0; long unsigned int wheel_left=500; for(i=0;i<500;i++) { wheel_left=350; wheel_left(wheel_left); delay_ms(10); rprintf("Wheel_Value=%d%d\r\n",wheel_left); } }void scan1(void) { long unsigned int i=0; long unsigned int wheel_left=500; for(i=0;i<500;i++) { wheel_left=900; wheel_left(wheel_left); delay_ms(10); rprintf("Wheel_Value=%d%d\r\n",wheel_left); } }
void control(void) { scan2(); scan1(); }
PORT_ON(PORTA,7);delay_ms(2);PORT_OFF(PORTA,7);delay_ms(20);
for(i=0;i<500;i++) { wheel_left=350; wheel_left(wheel_left); delay_ms(10); rprintf("Wheel_Value=%d%d\r\n",wheel_left); }
long int i=0;long int j=0;void servo1(signed int position) { PORT_ON(PORTA,7); delay_ms(position); PORT_OFF(PORTA,7); }void servo2(signed int position) { PORT_ON(PORTE,6); delay_ms(position); PORT_OFF(PORTE,6); }void scan(void) { for(j=0;j<500;j++) { for(i=500;i>0;i++) { servo1(2); servo2(1); delay_ms(20); } } for(j=0;j<500;j++) { for(i=500;i>0;i++) { servo1(1); servo2(2); delay_ms(20); } } }
void control(void) { while(1) { scan(); } }
My batteries are Alkaline batteries.
If it can't supply enough current, why do the servos work fine with the servo controller?
Also, what type of current rating should I looks for? I suppose I'd plan to use this for around 10 servos atleast (I plan on making a Quadruped robot).
Quote from: Canabots on May 13, 2009, 07:48:19 PMIf it can't supply enough current, why do the servos work fine with the servo controller?hmmmm good point lol . . .
Can you explain exactly what you servos are doing wrong in more detail? (assuming it's changed from the first post)