==================== Moving the Robot Arm ==================== .. raw:: html

Follow along: Moving the Robot Arm

The program launching process along with parameter settings are all simplified and set up on the Jupyter Notebook Environment.
(The Jetson Board used for these examples are => Jetson Nano)
.. raw:: html
- 05_01_left_right.ipynb - | Running the cell code. | `Ctrl + Enter` - To control the robot arm from code, don't forget to shut down the docker container. See `here `_. .. thumbnail:: /_images/arm/arm1.png - Load Arm_Lib module and register the robot arm as an object. .. code-block:: python import time from Arm_Lib import Arm_Device # Register robot arm object. Arm = Arm_Device() time.sleep(.1) - Run the below cell within your jupyter notebook. .. code-block:: python # Repeat swinging the robot arm up and down # Arm range = 0 ~ 180 def main(): # Make all servos in the middle. Arm.Arm_serial_servo_write6(90, 90, 90, 90, 90, 90, 500) time.sleep(1) while True: # Move the 3rd and 4th servos up and down. Arm.Arm_serial_servo_write(3, 0, 1000) time.sleep(.001) Arm.Arm_serial_servo_write(4, 180, 1000) time.sleep(1) # Move the 1st and 5th servos left and right. Arm.Arm_serial_servo_write(1, 180, 500) time.sleep(.001) Arm.Arm_serial_servo_write(5, 180, 500) time.sleep(0.51) Arm.Arm_serial_servo_write(1, 0, 1000) time.sleep(.001) Arm.Arm_serial_servo_write(5, 0, 500) time.sleep(1.1) # Move servo to initial position. Arm.Arm_serial_servo_write6(90, 90, 90, 90, 90, 90, 1000) time.sleep(1.5) try : main() except KeyboardInterrupt: # Move servo to initial position. Arm.Arm_serial_servo_write6(90, 90, 90, 90, 90, 90, 1000) print(" Program closed! ") pass - Remove the robot arm object. .. code-block:: python del Arm # Remove robot arm object.