functions to print and set speed
This commit is contained in:
parent
053d2b9726
commit
2712a72b75
@ -116,20 +116,22 @@ void loop() {
|
|||||||
printInfo();
|
printInfo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void printInfo(){
|
||||||
Serial.println("");
|
Serial.println("");
|
||||||
Serial.print(" pitch Angle = "); Serial.println(angle_pitch_output);
|
Serial.print("pitch Angle = "); Serial.println(angle_pitch_output);
|
||||||
Serial.print(" pitch Angle abs = "); Serial.println(abs(safe_angle));
|
Serial.print("pitch Angle abs = "); Serial.println(abs(safe_angle));
|
||||||
Serial.print(" pitch Angle measured = "); Serial.println(angle_pitch);
|
Serial.print("pitch Angle measured = "); Serial.println(angle_pitch);
|
||||||
Serial.print("Position: "); Serial.println(countA);
|
Serial.print("Position: "); Serial.println(countA);
|
||||||
|
Serial.print("Full Rotations: "); Serial.println(countA/56.0); //ca. 56 tick per rotation
|
||||||
|
Serial.print("Rads rotated: "); Serial.println(countA/8.91); //ca. 56 tick per rotation, 6.26 rads per rotation
|
||||||
|
Serial.print("RPM: "); Serial.println(rpm); //ca. 56 tick per rotation
|
||||||
|
Serial.print("Rads per second: "); Serial.println(rps); //ca. 56 tick per rotation, 6.26 rads per rotation
|
||||||
|
|
||||||
//Serial.print("A: "); Serial.println(countA);
|
//Serial.print("A: "); Serial.println(countA);
|
||||||
//Serial.print("B: "); Serial.println(countB);
|
//Serial.print("B: "); Serial.println(countB);
|
||||||
|
}
|
||||||
|
|
||||||
temp_loops = 0;
|
void setSpeed(){
|
||||||
}
|
|
||||||
else {
|
|
||||||
temp_loops++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(abs(safe_angle)<50 ){
|
if(abs(safe_angle)<50 ){
|
||||||
speed = 8*safe_angle;
|
speed = 8*safe_angle;
|
||||||
if(speed<0){
|
if(speed<0){
|
||||||
|
Loading…
Reference in New Issue
Block a user