Fixed i2c node not receiving request #19

Merged
Pimpest merged 1 commits from hotfix2 into main 2025-05-07 12:37:57 +00:00

View File

@ -25,7 +25,7 @@ class MgI2c : public rclcpp::Node {
rclcpp::Rate rate(100); rclcpp::Rate rate(100);
while (ch == 0 || (ch < 256 && ch > 0)) { while (ch == 0 || (ch > 255 || ch < 0)) {
ch = i2c_smbus_read_byte(i2c_fd_); ch = i2c_smbus_read_byte(i2c_fd_);
rate.sleep(); rate.sleep();
} }