Fixed i2c node not receiving request
This commit is contained in:
@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user