*/
# Contains? & ltreg 5 1 . h & gt;
Charles? Code? gcode[]="G 1? X5.3? Y0.2? Z6.3? F200.37? e 55.3”;
Charles? x _ Array[3]; //Save the characters after x.
Floating? x _ Float = 0; //X floating-point number
Invalid? Major (invalid)
{
Charles? Me? =? 0; //gcode[i]
Charles? j? =? 0; //X_Array[j]
* * * * * * * * * * * * * Take the character * * * * * * * * * * * * * * *
while(gcode[i]? ! =? '\0')
{
? Switch (gcode[i])
? {
? Charles? k? =? 0;
Case? x ':
for(; gcode[++i]? ! ='?' ; )
{
X_Array[k]? =? gcode[I];
? k++;
}
Break;
//case? y ':
//{…………}
//case? z ':
//{…………}
Default value:
Break;
}
i++;
}
/* * * * * * * * * * Character variable floating point number * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
And (j? & lt? 3)
{
Switch (j)
{
Case? 0:
X_Float? =? X_Array[j]? -? '0'; //bit
Break; ?
Case? 1:
Break; //decimal point
Case? 2:
X_Float? +=? (X_Array[j]? -? '0')/ 10; //One decimal place
Break; ?
}
j++;
}
while( 1);
}