by zekonology » Tue Nov 30, 2010 1:25 pm
I already tried your source code. I did not use microcontroller in my project. Thus, I only tried your VB source code. From your VB SC16A GUI, Servo1 will not hold its position after we moved the second servo.
My program moves the 1st servo and after few seconds it then moves the 2nd servo, however the 1st servo does not hold the position as soon as the 2nd servo moves. My question was and still,
1. How do I hold back servo1 in the same time move servo2?
- I want to hold the 1st servo and after a few seconds, move the next servo.
2. How to move two servos together (servo1 and servo2) and hold the position of both servos in VB. I tried sending 8 bytes together but it did not work.
This is my code in C to send the 4bytes command:
void set_com_pin(int servo, int high, int low, int speed)
{
char data = (char)servo;
char data2 = (char)high;
char data3 = (char)low;
char data4 = (char)speed;
DWORD written;
WriteFile(hPort, &data, 1, &written, NULL); // the 1st byte
WriteFile(hPort, &data2, 1, &written, NULL); // the 2nd byte
WriteFile(hPort, &data3, 1, &written, NULL); //the 3rd byte
WriteFile(hPort, &data4, 1, &written, NULL); //the 4th byte
}