Controlling Dynamixel AX-12A with NodeMCU ESP8266 on Arduino IDE



This video you will learn and get the Sketch code to controlling  Dynamixel Ax-12A Robot Actuator with NodeMCU

The Dynamixel AX-12 servos are different from regular hobby servos. They connect to a serial bus,and each an ID number

Hardware

1. NodeMCU ESP8266
2. Dynamixel Ax-12A Robot Actuator
3. Jumper wires
4. power supply dc 12V


Schematic diagram




NodeMCU connect to Dynamixel AX-12A


Arduino library to control Dynamixel AX-12A 

https://github.com/ThingType/AX-12A-servo-library


Arduino Sketch

#include <AX12A.h>

#define DirectionPin  (10u)
#define BaudRate    (1000000ul)
#define ID    (1u)

void setup()
{
  
 delay(1000); // Give time for Dynamixel to start on power-up 
 ax12a.begin(BaudRate, DirectionPin, &Serial);
 ax12a.setEndless(ID, ON);
}
void loop()
    ax12a.ledStatus(ID, ON);
    ax12a.turn(ID, LEFT, 100);
    delay(5000);
  
    ax12a.ledStatus(ID, OFF);
    ax12a.turn(ID, RIGHT, 500);
    delay(5000);
    
}

ความคิดเห็น