HM-E200 Programming Manual
SendStr[3] = 30;
SendStr[4] = 0; // Starting point
SendStr[5] = 104;
SendStr[6] = 1; // End point
PrtSendData(SendStr,7);
// Print curve
SendStr[0] = 0x1D;
SendStr[1] = 0x27;
SendStr[2] = 3; // Three lines:X-axis, sin and cos function curve
SendStr[3] = 180; SendStr[4] = 0; // x-axis position
SendStr[5] = 180; SendStr[6] = 0;
for(i=1;i<1200;i++){
y1 = sin(i/180*3.1416)*(380-30)/2+180; // Calculation of the sin function
coordinates
y2 = cos(i/180*3.1416)*(380-30)/2+180;// Calculation of the cos function
coordinates
if(i==1) { y1s = y1; y2s = y2; }
PrtSendData( SendStr, 7 );
if(y1s < y1)
{
PrtSendData( &y1s, 2 ); // Sin function curve at the starting point of the
line
PrtSendData( &y1, 2 ); // Sin function curve at the end point of the line
}
else
{
PrtSendData( &y1, 2 ); // Sin function curve at the starting
point of the line
PrtSendData( &y1s, 2 ); // Sin function curve at the end point
of the line
}
if(y2s < y2)
{
PrtSendData( &y2s, 2 ); // Cos function curve at the starting
point of the line
PrtSendData( &y2, 2 ); // Cos function curve at the end point of
the line
}
else
{
PrtSendData( &y2, 2 ); // Cos function curve at the starting
point of the line
PrtSendData( &y2s, 2 ); // Cos function curve at the end point
of the line
}
y1s = y1; //when print the next line, sin function curve at the starting
point of the line coordinate
y2s = y2; // when print the next line, cos function curve at the starting
point of the line coordinate
}