I’m using OpenRB-150 board with three XL430 servos and writing the code with Arduino IDE version 2.3.2. The board is powered from a high quality 60W 12V DC switching power supply. There is a switch between pin #1 (Arduino numbering) and GND. This is the test code:
#include <Arduino.h>
#include <OpenRB-150.h>
using namespace ControlTableItem;
constexpr uint8_t DXL_ID = 1;
constexpr float DXL_PROTOCOL_VERSION = 2.0;
constexpr int pin = 1; // Problem with pin 1
Dynamixel2Arduino dxl(Serial1, -1);
void setup() {
Serial.begin(115200);
pinMode(pin, INPUT_PULLUP);
// dxl.begin(57600);
// dxl.setPortProtocolVersion(DXL_PROTOCOL_VERSION);
// dxl.ping(DXL_ID);
// dxl.torqueOff(0);
delay(1000);
}
void loop() {
Serial.println(digitalRead(pin));
delay(100);
}
It behaves as expected when the dxl
calls are commented as shown above. Unfortunately, when I uncomment them, the state of pin #1 is stuck at zero. Why is that?
I would expect an occasional zero reading due to noise, but not all readings at 0 when the switch is open. When I use an external 1K pullup resistor, the behavior is back to normal.