def main(): """ A PyAX-12 demo. Print the internal temperature (in degrees celsius) of the specified Dynamixel unit. """ # Parse options parser = common_argument_parser(desc=main.__doc__) args = parser.parse_args() # Connect to the serial port serial_connection = Connection(args.port, args.baudrate, args.timeout) # Print the present internal temperature print(serial_connection.get_present_temperature(args.dynamixel_id)) # Close the serial connection serial_connection.close()
def main(): """ A PyAX-12 demo. Print the internal temperature (in degrees celsius) of the specified Dynamixel unit. """ # Parse options parser = common_argument_parser(desc=main.__doc__) args = parser.parse_args() # Connect to the serial port serial_connection = Connection(port=args.port, baudrate=args.baudrate, timeout=args.timeout, rpi_gpio=args.rpi) # Print the present internal temperature print(serial_connection.get_present_temperature(args.dynamixel_id)) # Close the serial connection serial_connection.close()
serial_connection = Connection(port=port, baudrate=baudrate, timeout=timeout, rpi_gpio=tx_rx) # Switch ON the LED serial_connection.write_data(dynamixel_id, pk.LED, 1) # Wait 2 seconds time.sleep(2) # Switch OFF the LED serial_connection.write_data(dynamixel_id, pk.LED, 0) # Wait 2 seconds time.sleep(2) # Switch ON the LED serial_connection.write_data(dynamixel_id, pk.LED, 1) # Wait 2 seconds time.sleep(2) # Switch OFF the LED serial_connection.write_data(dynamixel_id, pk.LED, 0) serial_connection.get_present_temperature(dynamixel_id) # Close the serial connection serial_connection.close()