laptophead
Well-known member
I have a pretty complex robot with 8 motors , I read encoders every 10ms.
I also transmit a lot of data to my Mac where I have a display and control center for the robot (Processing)
I am sending by Uart and BT at 115200.
In order to make the transmission not too long I use a rotation system of various data.
It is almost good enough, but I still have blocking, Here is the Scope.
See the gaps every so often? They disappear when I don't do the transmission above.
Is there a smart way to print out without blocking? Thanks a lot
Mitch
I also transmit a lot of data to my Mac where I have a display and control center for the robot (Processing)
I am sending by Uart and BT at 115200.
In order to make the transmission not too long I use a rotation system of various data.
HTML:
if (millis() - Transmission_Millis >= 100)
{ Transmission_Millis = millis();
///*
myLidarLite.distance(false);
TransInc++; // transmission incrementor
if (TransInc == 1)
{ Serial5.printf( "Mo:%d Step: %d Compl_L: %d Compl_H: %d Send:%d First: %c ReadEnc:%d Sh Gap:%d Calc_Once:%d DoOnce:%d \n",
Mode, StepNo, Compl_Legs(5), Compl_Head(5), SendOnce, First, ReadENC_Master, Show_Gaps, Calc_Once, DoOnce);
if (Show_Gaps == 1)
Serial.printf( " G1: %.1f° G2: %.1f° G3: %.1f° G11:%.1f° G12:%.1f° G13:%.1f° G5:%.1f° G6:%.1f° G7:%.1f° \n",
Gap_M[1], Gap_M[2], Gap_M[3], Gap_M[11], Gap_M[12], Gap_M[13], Gap_M[5], Gap_M[6] , Gap_M[7] );
}
else if (TransInc == 2)
{ Serial5.printf( "E%.1f, %.1f, %.1f, %.1f, %.1f, %.1f, %.1f, %.1f, %.1f, \n",
Mot_Ang_Read[1], Mot_Ang_Read[2], Mot_Ang_Read[3], Mot_Ang_Read[11], Mot_Ang_Read[12],
Mot_Ang_Read[13], Mot_Ang_Read[5], Mot_Ang_Read[6], Mot_Ang_Read[7]);
// Serial.printf( "E%.1f, %.1f, %.1f, %.1f, %.1f, %.1f, %.1f, %.1f, %.1f, \n",
// Mot_Ang_Read[1], Mot_Ang_Read[2], Mot_Ang_Read[3], Mot_Ang_Read[11], Mot_Ang_Read[12],
// Mot_Ang_Read[13], Mot_Ang_Read[5], Mot_Ang_Read[6], Mot_Ang_Read[7]);
}
else if (TransInc == 3)
{ Serial5.printf( "G%.1f %.1f %.1f \n", yaw, pch, rol);
TransInc = 0;
}
}
It is almost good enough, but I still have blocking, Here is the Scope.
See the gaps every so often? They disappear when I don't do the transmission above.
Is there a smart way to print out without blocking? Thanks a lot
Mitch