Home > Back-end >  Single-chip stepper motor serial communication
Single-chip stepper motor serial communication

Time:10-08

Using single-chip microcomputer control stepping motor, MCU and PC communication, access to coordinate control of step motor,
Drive the port set to sbit pul_0=P2 ^ 0;//level motor pulse input
Sbit dir_0=P2 ^ 1;//level of motor control end
Sbit ena_0=P2 ^ 2;//motor so that can end
Communication protocol is a moving target barycentric coordinates (X, Y) will continuously through the serial port output, program output 5 bytes, as shown in the following table, the opening of the first byte 0 x80, second, three bytes of barycentric coordinates X and Y respectively (in pixels), the fourth byte marked, 0 (the two cameras captured targets at the same time, 2 for moving targets beyond the view area, at the end of bytes for the final value of 0 xee, start bit and end value set to better ensure the effective transmission of data,

Data output description
0 x80 X Y FLAG 0 xee



Want to ask you, the c + + program how to write?

CodePudding user response:

Ask factory to sample code, faster,

CodePudding user response:

No one,,,,,,,,

CodePudding user response:

Buy another example code, faster.

CodePudding user response:

There is a problem with this agreement, if the X and Y in 0 x80 and 0 xee?
  • Related