Took 10 minutes
This commit is contained in:
2023-01-17 22:57:51 +01:00
parent cb72920611
commit 2fe26ef34b
6 changed files with 76 additions and 14 deletions

View File

@ -0,0 +1,8 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
"version": "0.2.0",
"configurations": [
]
}

View File

View File

@ -2,13 +2,25 @@
* Official proxy code for iTender GPIO Communication
**/
#include "HX711.h"
#include <ArduinoJson.h>
DynamicJsonDocument<200> doc;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.begin(9600);
while (!Serial) continue;
}
void loop() {
// put your main code here, to run repeatedly:
if( Serial.available() > 0 )
{
String data = Serial.readString();
}
}

43
arduino/itender/tare.ino Normal file
View File

@ -0,0 +1,43 @@
/**
#include "HX711.h"
const int LOADCELL_DOUT_PIN = 2;
const int LOADCELL_SCK_PIN = 3;
HX711 scale;
int minus = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
delay(1000);
Serial.println("TARE");
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
scale.set_scale(429.6159259259259);
scale.tare();
delay(1000);
minus=abs(scale.get_units(5));
// scale.set_scale();
// scale.tare();
// Serial.println("TARE OK - PLACE WEIGHT");
//delay(5000);
}
int len = 0;
long sum = 0;
void loop() {
if (scale.is_ready()) {
long data = scale.get_units(5) + minus;
Serial.println(data);
}
}
**/