Created
August 22, 2023 20:48
-
-
Save jmtexla68/8bb4f576b3ec2cd102395d43e921d3e2 to your computer and use it in GitHub Desktop.
Código con el valor de escalado corregido.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
*********************************************** | |
Tutorial Arduino Bascula Dosificadora | |
https://conbotassucias.wordpress.com/ | |
*********************************************** | |
Código con el valor de escalado corregido. | |
El valor de escalado lo hemos obtenido con ayuda del | |
sketch de calibración. | |
Con esto ya podemos pesar y verlo en el monitor serie. | |
*/ | |
#include "HX711.h" | |
const int DOUT=A1; | |
const int CLK=A0; | |
HX711 balanza; | |
void setup() { | |
Serial.begin(9600); | |
balanza.begin(DOUT, CLK); | |
Serial.print("Lectura del valor del ADC: "); | |
Serial.println(balanza.read()); | |
Serial.println("No ponga ningun objeto sobre la balanza"); | |
Serial.println("Destarando..."); | |
Serial.println("..."); | |
balanza.set_scale(411.03); // Establecemos la escala | |
balanza.tare(20); //El peso actual es considerado Tara. | |
Serial.println("Listo para pesar"); | |
} | |
void loop() { | |
Serial.print("Peso: "); | |
Serial.print(balanza.get_units(20),3); | |
Serial.println(" grs"); | |
delay(500); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment