I ordered several easyC-compatible boards but cannot find .ino sample code for I2C communication with the HX711 device. I found HX711 code but without easyC conversion. Can you help?
Originally submitted via email support on 15 February 2024. Migrated to the forum for community visibility.
I will have 8 PCBs HX711 with easyC connected on the same bus. To select the right address, I need to initialize it with the following code and association table, correct?
// Init HX711
hx711.begin(xx); //where xx could be 0x30 -> 0x37
The table is correct. Here is a table for easyC from one of our libraries:
The best way to be absolutely certain and avoid any errors is to use an I2C scanner sketch:
You can run this sketch on your main microcontroller and connect modules with different switches one by one and see which ones appear in the Serial monitor. When you connect an easyC module, it will print the address of that module so you can mark it.
I tried the samples in your library and got the same result. I already removed all delays. The cycle time appears to depend on the firmware of the ATTINY404 that converts the HX711 protocol to the easyC (I2C) protocol. Before purchasing this board I was testing a simple HX711 without easyC directly connected to Arduino and got good results (100mSec per reading). I selected your product because I need to check 8 load cells almost simultaneously and very fast. What do you suggest? Is it possible to change the ATTINY404 firmware to speed up the communication?
Here’s the sketch of the ATTINY404 firmware on the device:
There don’t seem to be any delays or reasons why it would take a while - so the time is probably as quick as it can be for 8 devices on the I2C bus.
I can offer this possibility: if you try it, you do so at your own responsibility as it deviates from our design and requires a small modification on the board.
Here’s the datasheet for the load-cell amplifier:
Here’s the schematic of our board:
The board has a RATE pin. If this pin is connected to 5V it offers a faster reading rate. Check the datasheet, Table 1. I’d suggest trying this modification on one board first - if it’s fast enough, it might be worth doing to the others.