Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Create an automated scale #11

Open
FlavioDime opened this issue Feb 3, 2022 · 0 comments
Open

Create an automated scale #11

FlavioDime opened this issue Feb 3, 2022 · 0 comments

Comments

@FlavioDime
Copy link

Hi, i'm a very beginner in coding, can you help me get a code for an automated scale?

i want to use an "if (scale < 50)" but i cant undestand what ("Scale is as an int or a float").

for example

#include <Q2HX711.h>

const byte hx711_data_pin = A2;
const byte hx711_clock_pin = A3;

Q2HX711 hx711(hx711_data_pin, hx711_clock_pin);

void setup() {
Serial.begin(9600);
pinMode(11, OUTPUT);
}

void loop() {
Serial.println(hx711.read()/100.0);
delay(200);
if (hx711.read()/100.0 < 50)
digitalWrite(11, HIGH);
if (hx711.read()/100.0 > 50)
digitalWrite(11, LOW);
delay(200);
}

Thanks

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant