Skip to main content
deleted 2 characters in body
Source Link

How do you make a load cell's amp HX711 measure both positive and negative values, or how do you set the center value for it? The main point is how to set the reference voltage (?) or something else so it can work like a joystick axis set it the center position, and work with an only lc or an extra one addadedadded, only one is preferable, say like a simple POT here.

That's a code for it.

#include <HX711.h>
#include <Joystick.h>
#define calibration_factor 400// Change this value to give accurate reading with your known mass.
#define DOUT  1
#define CLK  0
HX711 scale;
/*
Please check out our YouTube video series, Make your own loadcell pedals for sim racing
 
www.gpsimrigs.com
 
www.facebook.com/gpracesim
  */
Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID,
  JOYSTICK_TYPE_MULTI_AXIS, 4, 3,
  false, false, true, false, false, false,
  false, true, true, true, false);
 
 
 
int brake = 0;
int lastBrakeValue = 0;
 
void setup() {
  // Ranges are 1023 by default
   Joystick.setBrakeRange(0, 1023);
  
 
  Joystick.begin();
  Serial.begin(38400);
 
  scale.begin(DOUT, CLK);
  scale.set_scale(calibration_factor);
  scale.tare();
}
void loop() {
 
//Displays reading in Serial Monitor
 
    Serial.println (brake);
brake = scale.get_units(); // if the value is inverted put a - sign in front like -scale.get
 
   if (brake < 0 or brake < 1) {
    brake = 0;
  }
 
   if (lastBrakeValue != brake) {
     Joystick.setBrake(brake);
     lastBrakeValue = brake;
  }
}

How do you make a load cell's amp HX711 measure both positive and negative values, or how do you set the center value for it? The main point is how to set the reference voltage (?) or something else so it can work like a joystick axis set it the center position, and work with an only lc or an extra one addaded, only one is preferable, say like a simple POT here.

That's a code for it.

#include <HX711.h>
#include <Joystick.h>
#define calibration_factor 400// Change this value to give accurate reading with your known mass.
#define DOUT  1
#define CLK  0
HX711 scale;
/*
Please check out our YouTube video series, Make your own loadcell pedals for sim racing
 
www.gpsimrigs.com
 
www.facebook.com/gpracesim
  */
Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID,
  JOYSTICK_TYPE_MULTI_AXIS, 4, 3,
  false, false, true, false, false, false,
  false, true, true, true, false);
 
 
 
int brake = 0;
int lastBrakeValue = 0;
 
void setup() {
  // Ranges are 1023 by default
   Joystick.setBrakeRange(0, 1023);
  
 
  Joystick.begin();
  Serial.begin(38400);
 
  scale.begin(DOUT, CLK);
  scale.set_scale(calibration_factor);
  scale.tare();
}
void loop() {
 
//Displays reading in Serial Monitor
 
    Serial.println (brake);
brake = scale.get_units(); // if the value is inverted put a - sign in front like -scale.get
 
   if (brake < 0 or brake < 1) {
    brake = 0;
  }
 
   if (lastBrakeValue != brake) {
     Joystick.setBrake(brake);
     lastBrakeValue = brake;
  }
}

How do you make a load cell's amp HX711 measure both positive and negative values, or how do you set the center value for it? The main point is how to set the reference voltage (?) or something else so it can work like a joystick axis set it the center position, and work with an only lc or an extra one added, only one is preferable, say like a simple POT here.

That's a code for it.

#include <HX711.h>
#include <Joystick.h>
#define calibration_factor 400// Change this value to give accurate reading with your known mass.
#define DOUT  1
#define CLK  0
HX711 scale;
/*
Please check out our YouTube video series, Make your own loadcell pedals for sim racing
 
www.gpsimrigs.com
 
www.facebook.com/gpracesim
  */
Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID,
  JOYSTICK_TYPE_MULTI_AXIS, 4, 3,
  false, false, true, false, false, false,
  false, true, true, true, false);
 
 
 
int brake = 0;
int lastBrakeValue = 0;
 
void setup() {
  // Ranges are 1023 by default
   Joystick.setBrakeRange(0, 1023);
  
 
  Joystick.begin();
  Serial.begin(38400);
 
  scale.begin(DOUT, CLK);
  scale.set_scale(calibration_factor);
  scale.tare();
}
void loop() {
 
//Displays reading in Serial Monitor
 
    Serial.println (brake);
brake = scale.get_units(); // if the value is inverted put a - sign in front like -scale.get
 
   if (brake < 0 or brake < 1) {
    brake = 0;
  }
 
   if (lastBrakeValue != brake) {
     Joystick.setBrake(brake);
     lastBrakeValue = brake;
  }
}
Adding link for HX711
Source Link
Null
  • 7.7k
  • 17
  • 37
  • 48

Does anybody know how toHow do you make a load cell's amp HX711 to measure both positive and negative values, or how do you set the center value for it? The main point is how to set the reference voltage (?) or smthsomething else so it can work like a joystick axis set it the center position, and work with an only lc or an extra one addaded, only one is preferable, say like a simple POT here.

#include <HX711.h>

#include <Joystick.h> #define calibration_factor 400// Change this value to give accurate reading with your known mass. #define DOUT 1 #define CLK 0 HX711 scale; /* Please check out our YouTube video series, Make your own loadcell pedals for sim racing

www.gpsimrigs.com

www.facebook.com/gpracesim */ Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID, JOYSTICK_TYPE_MULTI_AXIS, 4, 3, false, false, true, false, false, false, false, true, true, true, false);

int brake = 0; int lastBrakeValue = 0;

void setup() { // Ranges are 1023 by default Joystick.setBrakeRange(0, 1023);

Joystick.begin(); Serial.begin(38400);

scale.begin(DOUT, CLK); scale.set_scale(calibration_factor); scale.tare(); } void loop() {

//Displays reading in Serial Monitor

#include <Joystick.h>
#define calibration_factor 400// Change this value to give accurate reading with your known mass.
#define DOUT  1
#define CLK  0
HX711 scale;
/*
Please check out our YouTube video series, Make your own loadcell pedals for sim racing
 
www.gpsimrigs.com
 
www.facebook.com/gpracesim
  */
Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID,
  JOYSTICK_TYPE_MULTI_AXIS, 4, 3,
  false, false, true, false, false, false,
  false, true, true, true, false);
 
 
 
int brake = 0;
int lastBrakeValue = 0;
 
void setup() {
  // Ranges are 1023 by default
   Joystick.setBrakeRange(0, 1023);
  
 
  Joystick.begin();
  Serial.begin(38400);
 
  scale.begin(DOUT, CLK);
  scale.set_scale(calibration_factor);
  scale.tare();
}
void loop() {
 
//Displays reading in Serial Monitor
 
    Serial.println (brake);
brake = scale.get_units(); // if the value is inverted put a - sign in front like -scale.get
 
   if (brake < 0 or brake < 1) {
    brake = 0;
  }
 
   if (lastBrakeValue != brake) {
     Joystick.setBrake(brake);
     lastBrakeValue = brake;
  }
}

brake = scale.get_units(); // if the value is inverted put a - sign in front like -scale.get

if (brake < 0 or brake < 1) { brake = 0; }

if (lastBrakeValue != brake) { Joystick.setBrake(brake); lastBrakeValue = brake; } }

Does anybody know how to make a load cell's amp HX711 to measure both positive and negative values, or how set the center value for it? The main point is how to set the reference voltage (?) or smth else so it can work like a joystick axis set it the center position, and work with an only lc or an extra one addaded, only one is preferable, say like a simple POT here.

#include <HX711.h>

#include <Joystick.h> #define calibration_factor 400// Change this value to give accurate reading with your known mass. #define DOUT 1 #define CLK 0 HX711 scale; /* Please check out our YouTube video series, Make your own loadcell pedals for sim racing

www.gpsimrigs.com

www.facebook.com/gpracesim */ Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID, JOYSTICK_TYPE_MULTI_AXIS, 4, 3, false, false, true, false, false, false, false, true, true, true, false);

int brake = 0; int lastBrakeValue = 0;

void setup() { // Ranges are 1023 by default Joystick.setBrakeRange(0, 1023);

Joystick.begin(); Serial.begin(38400);

scale.begin(DOUT, CLK); scale.set_scale(calibration_factor); scale.tare(); } void loop() {

//Displays reading in Serial Monitor

Serial.println (brake);

brake = scale.get_units(); // if the value is inverted put a - sign in front like -scale.get

if (brake < 0 or brake < 1) { brake = 0; }

if (lastBrakeValue != brake) { Joystick.setBrake(brake); lastBrakeValue = brake; } }

How do you make a load cell's amp HX711 measure both positive and negative values, or how do you set the center value for it? The main point is how to set the reference voltage (?) or something else so it can work like a joystick axis set it the center position, and work with an only lc or an extra one addaded, only one is preferable, say like a simple POT here.

#include <HX711.h>
#include <Joystick.h>
#define calibration_factor 400// Change this value to give accurate reading with your known mass.
#define DOUT  1
#define CLK  0
HX711 scale;
/*
Please check out our YouTube video series, Make your own loadcell pedals for sim racing
 
www.gpsimrigs.com
 
www.facebook.com/gpracesim
  */
Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID,
  JOYSTICK_TYPE_MULTI_AXIS, 4, 3,
  false, false, true, false, false, false,
  false, true, true, true, false);
 
 
 
int brake = 0;
int lastBrakeValue = 0;
 
void setup() {
  // Ranges are 1023 by default
   Joystick.setBrakeRange(0, 1023);
  
 
  Joystick.begin();
  Serial.begin(38400);
 
  scale.begin(DOUT, CLK);
  scale.set_scale(calibration_factor);
  scale.tare();
}
void loop() {
 
//Displays reading in Serial Monitor
 
    Serial.println (brake);
brake = scale.get_units(); // if the value is inverted put a - sign in front like -scale.get
 
   if (brake < 0 or brake < 1) {
    brake = 0;
  }
 
   if (lastBrakeValue != brake) {
     Joystick.setBrake(brake);
     lastBrakeValue = brake;
  }
}

Does anybody know how to make a load cell's amp HX711HX711 to measure both positive and negative values, or how set the center value for it? The main point is how to set the reference voltage (?) or smth else so it can work like a joystick axis set it the center position, and work with an only lc or an extra one addaded, only one is preferable, say like a simple POT here.

That's a code for it.

#include <HX711.h>

#include <Joystick.h> #define calibration_factor 400// Change this value to give accurate reading with your known mass. #define DOUT 1 #define CLK 0 HX711 scale; /* Please check out our YouTube video series, Make your own loadcell pedals for sim racing

www.gpsimrigs.com

www.facebook.com/gpracesim */ Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID, JOYSTICK_TYPE_MULTI_AXIS, 4, 3, false, false, true, false, false, false, false, true, true, true, false);

int brake = 0; int lastBrakeValue = 0;

void setup() { // Ranges are 1023 by default Joystick.setBrakeRange(0, 1023);

Joystick.begin(); Serial.begin(38400);

scale.begin(DOUT, CLK); scale.set_scale(calibration_factor); scale.tare(); } void loop() {

//Displays reading in Serial Monitor

Serial.println (brake);

brake = scale.get_units(); // if the value is inverted put a - sign in front like -scale.get

if (brake < 0 or brake < 1) { brake = 0; }

if (lastBrakeValue != brake) { Joystick.setBrake(brake); lastBrakeValue = brake; } }

Does anybody know how to make a load cell's amp HX711 to measure both positive and negative values, or how set the center value for it? The main point is how to set the reference voltage (?) or smth else so it can work like a joystick axis set it the center position, and work with an only lc or an extra one addaded, only one is preferable, say like a simple POT here.

That's a code for it.

#include <HX711.h>

#include <Joystick.h> #define calibration_factor 400// Change this value to give accurate reading with your known mass. #define DOUT 1 #define CLK 0 HX711 scale; /* Please check out our YouTube video series, Make your own loadcell pedals for sim racing

www.gpsimrigs.com

www.facebook.com/gpracesim */ Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID, JOYSTICK_TYPE_MULTI_AXIS, 4, 3, false, false, true, false, false, false, false, true, true, true, false);

int brake = 0; int lastBrakeValue = 0;

void setup() { // Ranges are 1023 by default Joystick.setBrakeRange(0, 1023);

Joystick.begin(); Serial.begin(38400);

scale.begin(DOUT, CLK); scale.set_scale(calibration_factor); scale.tare(); } void loop() {

//Displays reading in Serial Monitor

Serial.println (brake);

brake = scale.get_units(); // if the value is inverted put a - sign in front like -scale.get

if (brake < 0 or brake < 1) { brake = 0; }

if (lastBrakeValue != brake) { Joystick.setBrake(brake); lastBrakeValue = brake; } }

Does anybody know how to make a load cell's amp HX711 to measure both positive and negative values, or how set the center value for it? The main point is how to set the reference voltage (?) or smth else so it can work like a joystick axis set it the center position, and work with an only lc or an extra one addaded, only one is preferable, say like a simple POT here.

That's a code for it.

#include <HX711.h>

#include <Joystick.h> #define calibration_factor 400// Change this value to give accurate reading with your known mass. #define DOUT 1 #define CLK 0 HX711 scale; /* Please check out our YouTube video series, Make your own loadcell pedals for sim racing

www.gpsimrigs.com

www.facebook.com/gpracesim */ Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID, JOYSTICK_TYPE_MULTI_AXIS, 4, 3, false, false, true, false, false, false, false, true, true, true, false);

int brake = 0; int lastBrakeValue = 0;

void setup() { // Ranges are 1023 by default Joystick.setBrakeRange(0, 1023);

Joystick.begin(); Serial.begin(38400);

scale.begin(DOUT, CLK); scale.set_scale(calibration_factor); scale.tare(); } void loop() {

//Displays reading in Serial Monitor

Serial.println (brake);

brake = scale.get_units(); // if the value is inverted put a - sign in front like -scale.get

if (brake < 0 or brake < 1) { brake = 0; }

if (lastBrakeValue != brake) { Joystick.setBrake(brake); lastBrakeValue = brake; } }

Source Link
Loading