ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

i have the same problem to with arduino and ros commmunication.when i use hx711 library and ros library together i get this msg."Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino"

this is my code on arduino

include <ros.h>

include <std_msgs float64.h="">

include "HX711.h"

define DOUT 3//

define CLK 2//

HX711 scale; float calibration_factor = -5880; //-7050 worked for my 440lb max scale setup ros::NodeHandle nh;

std_msgs::Float64 test; ros::Publisher p2("my_topic", &test); void setup() { delay(2000); scale.begin(DOUT, CLK); scale.set_scale(); scale.tare(); //Reset the scale to 0 long zero_factor = scale.read_average(); //Get a baseline reading delay(2000); nh.initNode(); nh.advertise(p2); delay(2000); }

void loop() { delay(200); scale.set_scale(calibration_factor); //Adjust to this calibration factor float weight=(scale.get_units()); test.data = weight; p2.publish( &test ); nh.spinOnce(); }

ros command is this

rosrun rosserial_python serial_node.py /dev/ttyUSB1

is there any way to use hx711 withouth library.

click to hide/show revision 2
No.2 Revision

i have the same problem to with arduino and ros commmunication.when i use hx711 library and ros library together i get this msg."Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino"

this is my code on arduino

include <ros.h>

include <std_msgs float64.h="">

include "HX711.h"

define
#include <ros.h>
#include <std_msgs/Float64.h>
#include "HX711.h"
#define DOUT  3//

define 3// #define CLK 2//

2// HX711 scale; float calibration_factor = -5880; //-7050 worked for my 440lb max scale setup ros::NodeHandle nh;

nh; std_msgs::Float64 test; ros::Publisher p2("my_topic", &test); void setup() { delay(2000); scale.begin(DOUT, CLK); scale.set_scale(); scale.tare(); //Reset the scale to 0 long zero_factor = scale.read_average(); //Get a baseline reading delay(2000); nh.initNode(); nh.advertise(p2); delay(2000); }

} void loop() { delay(200); scale.set_scale(calibration_factor); //Adjust to this calibration factor float weight=(scale.get_units()); test.data = weight; p2.publish( &test ); nh.spinOnce(); }

}

ros command is this

rosrun rosserial_python serial_node.py /dev/ttyUSB1

is there any way to use hx711 withouth library.