Update
Took 10 minutes
This commit is contained in:
8
arduino/itender/.theia/launch.json
Normal file
8
arduino/itender/.theia/launch.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
|
||||
]
|
||||
}
|
0
arduino/itender/data/tare.ino
Normal file
0
arduino/itender/data/tare.ino
Normal 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
43
arduino/itender/tare.ino
Normal 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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
**/
|
Reference in New Issue
Block a user