Fixed i2c node not receiving request

This commit is contained in:
2025-05-07 14:33:58 +02:00
parent f89e3d580e
commit 8648a96bce

View File

@ -25,7 +25,7 @@ class MgI2c : public rclcpp::Node {
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_);
rate.sleep();
}