Advertisement
Guest User

Untitled

a guest
May 24th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. SetRS232Motor33f(int hUSB,short speed1,short speed2,unsigned char SpeedFlag) {
  2.  
  3. unsigned int n;
  4. unsigned char sbuf[20];
  5. int ress=0;
  6. unsigned char tt=0;
  7. sbuf[0] = 255;
  8. sbuf[1] = 0x07;
  9. sbuf[2] = (unsigned char)speed1;
  10. sbuf[3] = (unsigned char)(speed1 >> 8);
  11. sbuf[4] = (unsigned char)speed2;
  12. sbuf[5] = (unsigned char)(speed2 >> 8);
  13.  
  14. sbuf[6] = SpeedFlag;
  15.  
  16. short mycrcsend = crc16(sbuf+1,6);
  17.  
  18. sbuf[7] = (unsigned char)mycrcsend;
  19. sbuf[8] = (unsigned char)(mycrcsend >> 8);
  20.  
  21. ress = writers232(hUSB, sbuf, 9,&n);
  22. return ress;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement