Proteus Library: Hx711
Search for “HX711 Proteus Library” on GitHub or electronics forums.
Common files include:
Example source: The Engineering Projects or GitHub user: embeddedlab
#include "HX711.h"HX711 scale;
void setup() Serial.begin(9600); scale.begin(3, 2); // DOUT = D3, PD_SCK = D2 scale.set_scale(2280.f); // calibration factor scale.tare(); // reset to zero hx711 proteus library
void loop() float weight = scale.get_units(5); // average of 5 readings Serial.print("Weight: "); Serial.println(weight); delay(1000);
Upload this code to the virtual Arduino in Proteus. Use the HX711 library by Bogdan Necula. Search for “HX711 Proteus Library” on GitHub or
#include "HX711.h"#define DOUT 3 #define CLK 2
HX711 scale;
void setup() Serial.begin(9600); scale.begin(DOUT, CLK); scale.set_scale(2280.0); // Calibration factor scale.tare(); // Reset to zero Example source: The Engineering Projects or GitHub user:
void loop() float weight = scale.get_units(5); Serial.print("Weight: "); Serial.print(weight); Serial.println(" g"); delay(500);
In Proteus, add a Virtual Terminal to see weight readings.