I'm using a Dynamixel servo and an Arduino Uno in a project, and I'm trying to learn the controls for the servo using the built-in examples. I'm including a simple snippet of example code, which has the servo write to one position, pause, then write to another position, all in the main loop:
// Set Goal Position in RAW value dxl.setGoalPosition(DXL_ID, 0); delay(500); // Check if DYNAMIXEL is in motion while(dxl.readControlTableItem(MOVING, DXL_ID)); // Set Goal Position in angle(degree) dxl.setGoalPosition(DXL_ID, 179.0, UNIT_DEGREE); delay(500); // Check if DYNAMIXEL is in motion while(dxl.readControlTableItem(MOVING, DXL_ID));
The "while" loop at the end reads the servo feedback to see if it's moving, but I'm confused about how the true/false evaluation affects the code that follows. I'm familiar with the idea that
will wait until "something" is no longer true, what does "while" mean if there are no brackets?