load cell info op Oled schermpje

Arduino specifieke Software
Berichten: 11
Geregistreerd: 25 Nov 2015, 13:48

load cell info op Oled schermpje

Berichtdoor bartou » 17 Apr 2020, 12:48

Beste mede forummers,

Ik ben met een projectje bezig om de gegevens van 4 load cellen weer te geven.
Via de serial monitor heb ik het al voor elkaar.
Maart het wil me maar niet lukken om dit ook ook een Oled schermpje voor elkaar te krijgen.
Het is een SSD1306 schermpje.
Aangesloten op een Arduino Uno.

Code: Alles selecteren
//-------------------------------------------------------------------------------------
// HX711_ADC.h
// Arduino master library for HX711 24-Bit Analog-to-Digital Converter for Weigh Scales
// Olav Kallhovd sept2017
// Tested with      : HX711 asian module on channel A and YZC-133 3kg load cell
// Tested with MCU  : Arduino Nano
//-------------------------------------------------------------------------------------
// This is an example sketch on how to use this library for two ore more HX711 modules
// Settling time (number of samples) and data filtering can be adjusted in the config.h file

#include <HX711_ADC.h>
#include <EEPROM.h>

//HX711 constructor (dout pin, sck pin)
HX711_ADC LoadCell_1(2, 3); //HX711 1
HX711_ADC LoadCell_2(6, 7); //HX711 2
HX711_ADC LoadCell_3(8, 9); //HX711 3
HX711_ADC LoadCell_4(10, 11); //HX711 4

//const int eepromAdress_1 = 0; // eeprom adress for calibration value load cell 1 (4 bytes)
//const int eepromAdress_2 = 4; // eeprom adress for calibration value load cell 2 (4 bytes)
//const int eepromAdress_3 = 8; // eeprom adress for calibration value load cell 3 (4 bytes)
//const int eepromAdress_4 = 12; // eeprom adress for calibration value load cell 4 (4 bytes)

long t;

void setup() {
 
  float calValue_1; // calibration value load cell 1
  float calValue_2; // calibration value load cell 2
  float calValue_3; // calibration value load cell 3
  float calValue_4; // calibration value load cell 4
 
  calValue_1 = 1890.0; // uncomment this if you want to set this value in the sketch
  calValue_2 = 1890.0; // uncomment this if you want to set this value in the sketch
  calValue_3 = 1890.0; // uncomment this if you want to set this value in the sketch
  calValue_4 = 1890.0; // uncomment this if you want to set this value in the sketch
  #if defined(ESP8266)
  //EEPROM.begin(512); // uncomment this if you use ESP8266 and want to fetch the value from eeprom
  #endif
  //EEPROM.get(eepromAdress_1, calValue_1); // uncomment this if you want to fetch the value from eeprom
  //EEPROM.get(eepromAdress_2, calValue_2); // uncomment this if you want to fetch the value from eeprom
 
  Serial.begin(9600); delay(10);
  Serial.println();
  Serial.println("Starting...");
  LoadCell_1.begin();
  LoadCell_2.begin();
  LoadCell_3.begin();
  LoadCell_4.begin();
  long stabilisingtime = 4000; // tare preciscion can be improved by adding a few seconds of stabilising time
  byte loadcell_1_rdy = 0;
  byte loadcell_2_rdy = 0;
  byte loadcell_3_rdy = 0;
  byte loadcell_4_rdy = 0;
  while ((loadcell_1_rdy + loadcell_2_rdy + loadcell_3_rdy + loadcell_4_rdy) < 4) { //run startup, stabilization and tare, both modules simultaniously
    if (!loadcell_1_rdy) loadcell_1_rdy = LoadCell_1.startMultiple(stabilisingtime);
    if (!loadcell_2_rdy) loadcell_2_rdy = LoadCell_2.startMultiple(stabilisingtime);
    if (!loadcell_3_rdy) loadcell_3_rdy = LoadCell_3.startMultiple(stabilisingtime);
    if (!loadcell_4_rdy) loadcell_4_rdy = LoadCell_4.startMultiple(stabilisingtime);
  }
  if (LoadCell_1.getTareTimeoutFlag()) {
    //Serial.println("Tare timeout, check MCU>HX711 no.1 wiring and pin designations");
  }
  if (LoadCell_2.getTareTimeoutFlag()) {
    //Serial.println("Tare timeout, check MCU>HX711 no.2 wiring and pin designations");
  }
  if (LoadCell_3.getTareTimeoutFlag()) {
    //Serial.println("Tare timeout, check MCU>HX711 no.3 wiring and pin designations");
  }
  if (LoadCell_4.getTareTimeoutFlag()) {
    //Serial.println("Tare timeout, check MCU>HX711 no.4 wiring and pin designations");
  }
 
 
  LoadCell_1.setCalFactor(calValue_1); // user set calibration value (float)
  LoadCell_2.setCalFactor(calValue_2); // user set calibration value (float)
  LoadCell_3.setCalFactor(calValue_3); // user set calibration value (float)
  LoadCell_4.setCalFactor(calValue_4); // user set calibration value (float)
  Serial.println("Startup + tare is complete");
}

void loop() {
  //update() should be called at least as often as HX711 sample rate; >10Hz@10SPS, >80Hz@80SPS
  //longer delay in scetch will reduce effective sample rate (be carefull with use of delay() in the loop)
  LoadCell_1.update();
  LoadCell_2.update();
  LoadCell_3.update();
  LoadCell_4.update();

  //get smoothed value from data set + current calibration factor
  if (millis() > t + 2000) {
    float a = LoadCell_1.getData();
    float b = LoadCell_2.getData();
    float c = LoadCell_3.getData();
    float d = LoadCell_4.getData();
    Serial.print("Links voor gram   : ");
    Serial.println(a);
    Serial.print("Rechts voor gram  : ");
    Serial.println(b);
    Serial.print("Links achter gram : ");
    Serial.println(c);
    Serial.print("Rechts achter gram: ");
    Serial.println(d);
    Serial.print("Totaal gram       : ");
    Serial.println(a+b+c+d);
    t = millis();
 
  }

  //receive from serial terminal
  if (Serial.available() > 0) {
    float i;
    char inByte = Serial.read();
    if (inByte == 't') {
      LoadCell_1.tareNoDelay();
      LoadCell_2.tareNoDelay();
      LoadCell_3.tareNoDelay();
      LoadCell_4.tareNoDelay();
    }
  }

  //check if last tare operation is complete
  if (LoadCell_1.getTareStatus() == true) {
    Serial.println("Tare load cell 1 complete");
  }
  if (LoadCell_2.getTareStatus() == true) {
    Serial.println("Tare load cell 2 complete");
  }
  if (LoadCell_3.getTareStatus() == true) {
    Serial.println("Tare load cell 3 complete");
  }
  if (LoadCell_4.getTareStatus() == true) {
    Serial.println("Tare load cell 4 complete");
  }
 

}


Bovenstaand de code waarmee het prima werkt via de seriële monitor.


Code: Alles selecteren
//-------------------------------------------------------------------------------------
// HX711_ADC.h
// Arduino master library for HX711 24-Bit Analog-to-Digital Converter for Weigh Scales
// Olav Kallhovd sept2017
// Tested with      : HX711 asian module on channel A and YZC-133 3kg load cell
// Tested with MCU  : Arduino Nano
//-------------------------------------------------------------------------------------
// This is an example sketch on how to use this library for two ore more HX711 modules
// Settling time (number of samples) and data filtering can be adjusted in the config.h file

#include <HX711_ADC.h>
#include <EEPROM.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels

// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET     -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);


//HX711 constructor (dout pin, sck pin)
HX711_ADC LoadCell_1(A0, A1); //HX711 1
HX711_ADC LoadCell_2(6, 7); //HX711 2
HX711_ADC LoadCell_3(8, 9); //HX711 3
HX711_ADC LoadCell_4(10, 11); //HX711 4

//const int eepromAdress_1 = 0; // eeprom adress for calibration value load cell 1 (4 bytes)
//const int eepromAdress_2 = 4; // eeprom adress for calibration value load cell 2 (4 bytes)
//const int eepromAdress_3 = 8; // eeprom adress for calibration value load cell 3 (4 bytes)
//const int eepromAdress_4 = 12; // eeprom adress for calibration value load cell 4 (4 bytes)

long t;

void setup() {
   
  Serial.begin(9600); delay(10);
  // SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64
    Serial.println(F("SSD1306 allocation failed"));
    //for(;;); // Don't proceed, loop forever
  }
 
 
 
  float calValue_1; // calibration value load cell 1
  float calValue_2; // calibration value load cell 2
  float calValue_3; // calibration value load cell 3
  float calValue_4; // calibration value load cell 4
 
  calValue_1 = 1890.0; // uncomment this if you want to set this value in the sketch
  calValue_2 = 1890.0; // uncomment this if you want to set this value in the sketch
  calValue_3 = 1890.0; // uncomment this if you want to set this value in the sketch
  calValue_4 = 1890.0; // uncomment this if you want to set this value in the sketch
  #if defined(ESP8266)
  //EEPROM.begin(512); // uncomment this if you use ESP8266 and want to fetch the value from eeprom
  #endif
  //EEPROM.get(eepromAdress_1, calValue_1); // uncomment this if you want to fetch the value from eeprom
  //EEPROM.get(eepromAdress_2, calValue_2); // uncomment this if you want to fetch the value from eeprom
 
 
  Serial.println();
  Serial.println("Starting...");
  LoadCell_1.begin();
  LoadCell_2.begin();
  LoadCell_3.begin();
  LoadCell_4.begin();
  long stabilisingtime = 4000; // tare preciscion can be improved by adding a few seconds of stabilising time
  byte loadcell_1_rdy = 0;
  byte loadcell_2_rdy = 0;
  byte loadcell_3_rdy = 0;
  byte loadcell_4_rdy = 0;
  while ((loadcell_1_rdy + loadcell_2_rdy + loadcell_3_rdy + loadcell_4_rdy) < 4) { //run startup, stabilization and tare, both modules simultaniously
    if (!loadcell_1_rdy) loadcell_1_rdy = LoadCell_1.startMultiple(stabilisingtime);
    if (!loadcell_2_rdy) loadcell_2_rdy = LoadCell_2.startMultiple(stabilisingtime);
    if (!loadcell_3_rdy) loadcell_3_rdy = LoadCell_3.startMultiple(stabilisingtime);
    if (!loadcell_4_rdy) loadcell_4_rdy = LoadCell_4.startMultiple(stabilisingtime);
  }
  if (LoadCell_1.getTareTimeoutFlag()) {
    //Serial.println("Tare timeout, check MCU>HX711 no.1 wiring and pin designations");
  }
  if (LoadCell_2.getTareTimeoutFlag()) {
    //Serial.println("Tare timeout, check MCU>HX711 no.2 wiring and pin designations");
  }
  if (LoadCell_3.getTareTimeoutFlag()) {
    //Serial.println("Tare timeout, check MCU>HX711 no.3 wiring and pin designations");
  }
  if (LoadCell_4.getTareTimeoutFlag()) {
    //Serial.println("Tare timeout, check MCU>HX711 no.4 wiring and pin designations");
  }
 
 
  LoadCell_1.setCalFactor(calValue_1); // user set calibration value (float)
  LoadCell_2.setCalFactor(calValue_2); // user set calibration value (float)
  LoadCell_3.setCalFactor(calValue_3); // user set calibration value (float)
  LoadCell_4.setCalFactor(calValue_4); // user set calibration value (float)
  Serial.println("Startup + tare is complete");
}

void loop() {
  //update() should be called at least as often as HX711 sample rate; >10Hz@10SPS, >80Hz@80SPS
  //longer delay in scetch will reduce effective sample rate (be carefull with use of delay() in the loop)
  LoadCell_1.update();
  LoadCell_2.update();
  LoadCell_3.update();
  LoadCell_4.update();

  //get smoothed value from data set + current calibration factor
 
  if (millis() > t + 2000) {
    float a = LoadCell_1.getData();
    float b = LoadCell_2.getData();
    float c = LoadCell_3.getData();
    float d = LoadCell_4.getData();
    //display.begin(SSD1306_SWITCHCAPVCC, 0x3C); //initialize with the I2C addr 0x3C (128x64)
    display.clearDisplay();
    display.setTextSize(1);
    display.setTextColor(SSD1306_WHITE);
    display.setCursor(0, 0); //oled display
    display.cp437(true);
    display.write(a);
    display.display();
    delay(2000);
    //display.display();
    //display.setCursor(90,20);
    //display.setTextSize(1);
    //display.println("Links voor gram   : ");
    //display.print("Links voor gram   : ");
    //display.println(a);
    //display.print("Rechts voor gram  : ");
    //display.println(b);
    //display.print("Links achter gram : ");
    //display.println(c);
    //display.print("Rechts achter gram: ");
    //display.println(d);
    //display.print("Totaal gram       : ");
    //display.println(a+b+c+d);
    t = millis();
 
  }

  //receive from serial terminal
  if (Serial.available() > 0) {
    float i;
    char inByte = Serial.read();
    if (inByte == 't') {
      LoadCell_1.tareNoDelay();
      LoadCell_2.tareNoDelay();
      LoadCell_3.tareNoDelay();
      LoadCell_4.tareNoDelay();
    }
  }

  //check if last tare operation is complete
  if (LoadCell_1.getTareStatus() == true) {
    Serial.println("Tare load cell 1 complete");
  }
  if (LoadCell_2.getTareStatus() == true) {
    Serial.println("Tare load cell 2 complete");
  }
  if (LoadCell_3.getTareStatus() == true) {
    Serial.println("Tare load cell 3 complete");
  }
  if (LoadCell_4.getTareStatus() == true) {
    Serial.println("Tare load cell 4 complete");
  }
 
 

}


Bovenstaand de code waarmee het niet lukt.
Alvast heeeeel erg bedankt voor de hulp!!
De bedoeling is om bij een 1:10 rc auto de gewichtsverdeling afzonderlijk van de 4 wielen te meten.
En het totaal gewicht.
Let wel op dat niet al te veel ervaring heb in het programmeren met een Arduino.

Groeten van Bart.

Advertisement

Berichten: 4064
Geregistreerd: 16 Okt 2013, 14:31
Woonplaats: s hertogenbosch

Re: load cell info op Oled schermpje

Berichtdoor shooter » 18 Apr 2020, 10:36

ik denk dat er iets misgaat in de timers die door de loadcell ook gebruikt wordt, zet de cellen even uit en alleen je LCD als dat goed werkt en je zet een HX711 in de aanroep als library weet je gelijk waar het fout gaat.
je kunt dan wellicht je loadcellen even uitzeyyen als je het display bedient en andersom.
paul deelen
shooter@home.nl

Berichten: 11
Geregistreerd: 25 Nov 2015, 13:48

Re: load cell info op Oled schermpje

Berichtdoor bartou » 19 Apr 2020, 12:22

hey hallo,

Bedankt voor je reactie.
Nu moet ik alleen nog weten hoe ik een cell uit zet.
Nogmaals, ik ben niet zo gevorderd met Arduino om te weten hoe dat moet.
Maar met de hulp van dit forum moet ik een heel eind komen.
Alvast bedankt!!

Groeten van Bart.

Berichten: 4064
Geregistreerd: 16 Okt 2013, 14:31
Woonplaats: s hertogenbosch

Re: load cell info op Oled schermpje

Berichtdoor shooter » 20 Apr 2020, 08:58

ik zie ook geen display.begin staan. Zet eens je hele loadcell gebeuren in commentaar met /* of zet dat in een aparte functie dat is ook heel goed om overzicht te bewaren. dan ook meer serial.print toevoegen dan kun je zien wat er gebeurt en misgaat.
paul deelen
shooter@home.nl

Berichten: 11
Geregistreerd: 25 Nov 2015, 13:48

Re: load cell info op Oled schermpje

Berichtdoor bartou » 21 Apr 2020, 11:20

Code: Alles selecteren
//-------------------------------------------------------------------------------------
// HX711_ADC.h
// Arduino master library for HX711 24-Bit Analog-to-Digital Converter for Weigh Scales
// Olav Kallhovd sept2017
// Tested with      : HX711 asian module on channel A and YZC-133 3kg load cell
// Tested with MCU  : Arduino Nano
//-------------------------------------------------------------------------------------
// This is an example sketch on how to use this library for two ore more HX711 modules
// Settling time (number of samples) and data filtering can be adjusted in the config.h file

#include <HX711_ADC.h>
#include <EEPROM.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels

// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET     -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);


//HX711 constructor (dout pin, sck pin)
HX711_ADC LoadCell_1(2, 3); //HX711 1
HX711_ADC LoadCell_2(6, 7); //HX711 2
HX711_ADC LoadCell_3(8, 9); //HX711 3
HX711_ADC LoadCell_4(10, 11); //HX711 4

//const int eepromAdress_1 = 0; // eeprom adress for calibration value load cell 1 (4 bytes)
//const int eepromAdress_2 = 4; // eeprom adress for calibration value load cell 2 (4 bytes)
//const int eepromAdress_3 = 8; // eeprom adress for calibration value load cell 3 (4 bytes)
//const int eepromAdress_4 = 12; // eeprom adress for calibration value load cell 4 (4 bytes)

long t;

void setup() {
   
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C); //initialize with the I2C addr 0x3C (128x64)
  delay(2000);
  //Serial.begin(9600); delay(8000);
 
  // SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
  //if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64
    //Serial.println(F("SSD1306 allocation failed"));
    //for(;;); // Don't proceed, loop forever
  //}
 
 
 
  float calValue_1; // calibration value load cell 1
  float calValue_2; // calibration value load cell 2
  float calValue_3; // calibration value load cell 3
  float calValue_4; // calibration value load cell 4
 
  calValue_1 = 1898.19; // uncomment this if you want to set this value in the sketch
  calValue_2 = 1890.0; // uncomment this if you want to set this value in the sketch
  calValue_3 = 1890.0; // uncomment this if you want to set this value in the sketch
  calValue_4 = 1883.06; // uncomment this if you want to set this value in the sketch
  #if defined(ESP8266)
  //EEPROM.begin(512); // uncomment this if you use ESP8266 and want to fetch the value from eeprom
  #endif
  //EEPROM.get(eepromAdress_1, calValue_1); // uncomment this if you want to fetch the value from eeprom
  //EEPROM.get(eepromAdress_2, calValue_2); // uncomment this if you want to fetch the value from eeprom
 
 
  //display.clearDisplay();
  //display.setTextSize(1);
  //display.setTextColor(WHITE);
  //display.setCursor(0, 0); //oled display
  //display.cp437(true);
  //display.println();
  //display.println("Starting...");
  //display.display();
  //delay(250);
  //display.clearDisplay();
  LoadCell_1.begin();
  LoadCell_2.begin();
  LoadCell_3.begin();
  LoadCell_4.begin();
  long stabilisingtime = 200; // tare preciscion can be improved by adding a few seconds of stabilising time
  byte loadcell_1_rdy = 0;
  byte loadcell_2_rdy = 0;
  byte loadcell_3_rdy = 0;
  byte loadcell_4_rdy = 0;
  while ((loadcell_1_rdy + loadcell_2_rdy + loadcell_3_rdy + loadcell_4_rdy) < 4) { //run startup, stabilization and tare, both modules simultaniously
    if (!loadcell_1_rdy) loadcell_1_rdy = LoadCell_1.startMultiple(stabilisingtime);
    if (!loadcell_2_rdy) loadcell_2_rdy = LoadCell_2.startMultiple(stabilisingtime);
    if (!loadcell_3_rdy) loadcell_3_rdy = LoadCell_3.startMultiple(stabilisingtime);
    if (!loadcell_4_rdy) loadcell_4_rdy = LoadCell_4.startMultiple(stabilisingtime);
  }
  //if (LoadCell_1.getTareTimeoutFlag()) {
    //Serial.println("Tare timeout, check MCU>HX711 no.1 wiring and pin designations");
  //}
  //if (LoadCell_2.getTareTimeoutFlag()) {
    //Serial.println("Tare timeout, check MCU>HX711 no.2 wiring and pin designations");
  //}
  //if (LoadCell_3.getTareTimeoutFlag()) {
    //Serial.println("Tare timeout, check MCU>HX711 no.3 wiring and pin designations");
  //}
  //if (LoadCell_4.getTareTimeoutFlag()) {
    //Serial.println("Tare timeout, check MCU>HX711 no.4 wiring and pin designations");
  //}
 
 
  LoadCell_1.setCalFactor(calValue_1); // user set calibration value (float)
  LoadCell_2.setCalFactor(calValue_2); // user set calibration value (float)
  LoadCell_3.setCalFactor(calValue_3); // user set calibration value (float)
  LoadCell_4.setCalFactor(calValue_4); // user set calibration value (float)
  //Serial.println("Startup + tare is complete");
}

void loop() {
  //update() should be called at least as often as HX711 sample rate; >10Hz@10SPS, >80Hz@80SPS
  //longer delay in scetch will reduce effective sample rate (be carefull with use of delay() in the loop)
  LoadCell_1.update();
  LoadCell_2.update();
  LoadCell_3.update();
  LoadCell_4.update();

  //get smoothed value from data set + current calibration factor
 
  if (millis() > t + 2000) {
    float a = LoadCell_1.getData();
    float b = LoadCell_2.getData();
    float c = LoadCell_3.getData();
    float d = LoadCell_4.getData();
   
    display.clearDisplay();
    display.setTextSize(1);
    display.setTextColor(WHITE);
    display.setCursor(0, 0); //oled display
    //display.cp437(true);
    display.print(F("LV:"));
    display.println(a);
    display.display();
    //display.setCursor(0, 12);
    //display.cp437(true);
    display.print(F("RV:"));
    display.println(b);
    display.display();
    //display.setCursor(0, 24);
    //display.cp437(true);
    display.print(F("LA:"));
    display.println(c);
    display.display();
    //display.setCursor(0, 36);
    //display.cp437(true);
    display.print(F("RA:"));
    display.println(d);
    display.display();
    //display.cp437(true);
    display.print(F("Totaal:"));
    display.println(a+b+c+d);
    display.display();
    delay(2000);
    //display.display();
    //display.setCursor(90,20);
    //display.setTextSize(1);
    //display.println("Links voor gram   : ");
    //display.print("Links voor gram   : ");
    //display.println(b);
    //display.display();
    //delay(20);
    //display.print("Rechts voor gram  : ");
    //display.println(b);
    //display.print("Links achter gram : ");
    //display.println(c);
    //display.print("Rechts achter gram: ");
    //display.println(d);
    //display.print("Totaal gram       : ");
    //display.println(a+b+c+d);
    t = millis();
 
  }

  //receive from serial terminal
  //if (Serial.available() > 0) {
   // float i;
   // char inByte = Serial.read();
    //if (inByte == 't') {
      //LoadCell_1.tareNoDelay();
      //LoadCell_2.tareNoDelay();
      //LoadCell_3.tareNoDelay();
      //LoadCell_4.tareNoDelay();
    //}
  }

  //check if last tare operation is complete
  //if (LoadCell_1.getTareStatus() == true) {
    //Serial.println("Tare load cell 1 complete");
//  }
  //if (LoadCell_2.getTareStatus() == true) {
    //Serial.println("Tare load cell 2 complete");
//  }
  //if (LoadCell_3.getTareStatus() == true) {
    //Serial.println("Tare load cell 3 complete");
//  }
//  if (LoadCell_4.getTareStatus() == true) {
    //Serial.println("Tare load cell 4 complete");
//  }
 
 

//}


Met deze code is het me gelukt.
Echter zie je scherm telkens "refreshen", flikkeren zeg maar.....
Maar het is me to zover gelukt.
Ik had wel een "display.begin" in de vorige code staan maar zie nu dat die in de code hier in de thread // bevat
Waar het waarschijnlijk aan gelegen heeft is dat er inderdaad erg veel delays door elkaar heen lopen denk ik.
Correct me if I am wrong!
achteraf gezien zou een grotere display wel fijner zijn geweest...

Groeten van Bart.
Wordt vervolgd!!

Berichten: 4064
Geregistreerd: 16 Okt 2013, 14:31
Woonplaats: s hertogenbosch

Re: load cell info op Oled schermpje

Berichtdoor shooter » 21 Apr 2020, 13:59

volgende stap:
zet het hele loadcell spul in een functie. en roep die af en toe (1/seconde aam)
zet het hele display gebeuren ook in een functie en zet daar ook een timer op bijvoorbeeld elke 10 seconden.
dat scheelt in flikkeren maar ook in stroomverbruik.
dan vervolgens op een tafel neerzetten zodat je een auto erop zet en dan aan de veren kunt rommelen tot het naar jouw smaak is.
ik weet dat F1 daar heel erg druk is om in een bocht het gewicht te verplaatsen.
denk ook eens aan slingerschotten bij de benzinetank (haha).
paul deelen
shooter@home.nl

Berichten: 11
Geregistreerd: 25 Nov 2015, 13:48

Re: load cell info op Oled schermpje

Berichtdoor bartou » 23 Apr 2020, 11:15

Dan moet ik in de boeken gaan duiken hoe dat moet. :)
Leuk om het weekend mee door te komen.
Bedankt voor het meedenken in ieder geval!
Wordt vervolgd!

Groeten van Bart.

Terug naar Arduino software

Wie is er online?

Gebruikers in dit forum: Eleanorchats, ubeyolod en 21 gasten