New to the forums, I've been searching through the forums and found some great information and was able to get mostly everything working. Just need some help with one last thing and any help would be greatly appreciated!
Currently using a full bridge load cell with an HX711 amplifier on an Arduino Leonardo R3. Everything works great and I tested using libraries found on Arduino forum using analog or even digital side and they both worked.
The issue is, when I'm trying to get the load cell to read on the joystick game controller library, I'm getting nothing at all, whether it's on analog or digital side. I quickly unplugged to check the analog port with a potentiometer to make sure the code is correct and it responds perfectly.
Is there anything I can do to fix this? What I'm using it for is a brake pedal for vehicle/racing simulators. Then A3102 Hall Effect sensors for the throttle and clutch.
I've attached a picture on how I wired the load cell and a picture of the PC device controller, ignore the current inputs, I had random potentiometers connected
for example throttle I put for my loadcell just for testing:
Throttle_ = analogRead(A0)/4; I tried sck and dt as A0 from amplifier, but no input was detected
Throttle_ = map(Throttle_,0,-255,255,0);
Joystick.setThrottle(Throttle_);
Thanks for checking out my thread!
If there's something I forgot please let me know
Just to add, another thing I tried using was a program called mmjoy2 which works great, but on the digital end the HX711 is not supported so I'm really not sure what approach to use, stumped
Yeah I had it wired up in analog to test and digital form after and it still only worked on the Arduino serial monitor, do you think it's possible to match up the joystick library with the HX711 library to get a proper output via controller on my project?
I have both of them installed, but unsure on what code would actually be needed to read the HX711 output and force it into the joystick coding.
If I include that, last time it did not work, but maybe I put the wrong digital pin in the throttle section?
For example:
#include <Hx711.h>
Hx711 scale(2, 3);
Throttle_ = analogRead(2)/4; // <<< if I try 2 or 3 in here, no value
Throttle_ = map(Throttle_,0,-255,255,0);
Joystick.setThrottle(Throttle_);
johnwasser:
WHY are you using analogRead() instead of scale.getGram() to get the value from the force cell?!?
I was not sure exactly how the library worked with the joystick, but changing it to scale.getGram() got me some feedback! Except it's incredibly slow, I need live feed of the load cell, so I'll try the HX711 library you sent, maybe it's quicker.
I was able to use the other HX711 library (HX711 - Master) and got a stable output, thanks for all your help!
After reading some other threads, I might use this HX711 temporary and replace it with a INA122 chip later on since it's analog output and has a much faster response time, vs HX711 maximum of 80hz which is fairly slow.