#include #include #include #include #include #include #include "serial.h" void main() { // variables used with the com port __time64_t time1; //Setup for penetrometer motor Serial motor(1); //uses com1 by default motor.Setup(); char buff[1024]; char* str = (char*)malloc( 1024*sizeof( char ) ); int bufsize = 1024; int strlen = 1024; for(int i=1; i<=10; i++) { printf("motor initialized\n"); bufsize = 1024; motor.WaitForChar(buff, bufsize); } /* motor.WriteBuffer("4", 1); bufsize = 1024; printf( "Motor ready\n" ); motor.WaitForChar(buff, bufsize, '-'); //main for loop for(int j=1;j<=2;j++) { //motor controller reads input one character at a time, hence the for loops below. str = "v=721:@2=1:home:w=20:init\r";//initialize motor strlen = 26; for(int i=0; i