ggurov / hx711

raspberry pi hx711 weight scale interface
56 stars 33 forks source link

Getting error after make #11

Open arthurmoises opened 8 years ago

arthurmoises commented 8 years ago

Hi! Thanks for sharing this great project! I'm also a big fan of hivetool as a whole!

I'm getting the following errors after cloning the project to local folder and running make:

gcc -o hx711 hx711.c gb_common.o hx711.c: In function ‘main’: hx711.c:127:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=] printf("%d\n", (tmp_avg2 / j) - offset); ^ hx711.c: In function ‘read_cnt’: hx711.c:215:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=] printf("n: %10d - ", count - offset); ^ /usr/bin/ld: gb_common.o: Relocations in generic ELF (EM: 40) gb_common.o: error adding symbols: File in wrong format collect2: error: ld returned 1 exit status make: *** [hx711] Error 1

I'm using make correctly? Can I solve this issue by changing the int variables to long int ones?

Thanks in advance!

EDIT: I've managed to "make" it with gcc inside raspberry pi. It compiled as well. You can close this thread. Next step is to see why I'm getting "No data to consider errors". But I'm still trying to see if I've connected the pins the right way (still a bit confused using BCM I/Os on Rasp2 model B v1.1.

EDIT2: I've realized that pins in .c code were in "Board Numbering System", instead of "BCM Numbering system". On a raspberry 2 I've managed to wire the Dout and Sck into 12 and 11 board pins, respectively. Instead of "No data to consider" message, I'm receiving no output. The command line simply awaits for the command to respond. I think those pins are used for other thing on raspberry pi interface, which I'm going to use 37 and 38 Board pins, instead, to confirm that.

EDIT3: Implemented the commit from ComSubVie, which contained changes for the Raspberry PI. Now, all implementations and wirings just output "no data to consider". I feel that now I'm getting there.