Go Down

Topic: i need help please see code and correct. please please (Read 681 times) previous topic - next topic

pawanm22

#include "HX711.h"
#include <Keypad.h>
  #define DOUT 12
  #define CLK 13
    HX711 scale(DOUT,CLK);

float x, y ;

void setup()
{
  pinMode(LED_BUILTIN, OUTPUT);
  loop();
}

void high()
{
  digitalWrite(LED_BUILTIN, HIGH); 
   loadcell();
}

void low()

  digitalWrite(LED_BUILTIN, LOW);
  {
    setup();
  }
}


void loadcell()

{
   float calibration_factor = -396650;
  scale.set_scale(-396650);
  Serial.print("wait 5 second:");
  Serial.print (scale.get_value(),3);
  x = scale.get_value(),3;
  Serial.print("kg");
   
  if ( x == y )
  {
   Serial.print(" Please remove the bag is filled ");
   low();
        }
        else{
          loadcell();
        }
   }

void loop()
{
  const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
char keys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};

byte rowPins[ROWS] = {5, 4, 3, 2};
byte colPins[COLS] = {9, 8, 7, 6};

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
       char key = keypad.getKey();
       if (key)
       {
        Serial.print("keypressed is =");
        Serial.print(key);
        high();
        x = key;
                }
       
             
             }

JairajDange

What you want to correct in code, what is aim of your code?

Go Up