Shop OBEX P1 Docs P2 Docs Learn Events
Problem with position query — Parallax Forums

Problem with position query

Nora_HarbNora_Harb Posts: 1
edited 2012-04-23 09:12 in General Discussion
I'm using tha parallax motor and sending a position query command using the following code in C
void QPOS(HANDLE hCom){

byte input[2];

 

unsignedchar command[] = {0x08};
WriteFile(hCom,command, 1, &read,NULL);
Sleep(100);
ReadFile(hCom, input, 2, &read, &osReader);
}



However, when i send the query, the next write command does not pass through and the position read is not getting sent.
All i get is garbage

whats the solution for this? how could i send a query command and recieve the position correctly?


//cout<<input;


return fWaitingOnRead;
Sign In or Register to comment.