Load Cell IF statements

Programming newbie here, I am working on a project that should be able to identify a material chip. I am currently using a 4-wire Loadcell hooked up to a hx711 amp like many tutorials online use. I have the loadcell calibrated to the weight in grams, this part is working fine. My issue is that I am trying to add some if or if-else statements into the program so that when I put a chip on the loadcell, the arduino will output via Serial Monitor which chip it is. Just fyi I am using the same code from https://www.hackster.io/MOHAN_CHANDALURU/hx711-load-cell-amplifier-interface-with-arduino-fa47f3 with the same digital pins and my loadcells calibration factor. Any ideas or suggestions? Thanks!

maddog859:
Programming newbie here, I am working on a project that should be able to identify a material chip. I am currently using a 4-wire Loadcell hooked up to a hx711 amp like many tutorials online use. I have the loadcell calibrated to the weight in grams, this part is working fine. My issue is that I am trying to add some if or if-else statements into the program so that when I put a chip on the loadcell, the arduino will output via Serial Monitor which chip it is. Just fyi I am using the same code from https://www.hackster.io/MOHAN_CHANDALURU/hx711-load-cell-amplifier-interface-with-arduino-fa47f3 with the same digital pins and my loadcells calibration factor. Any ideas or suggestions? Thanks!

What have you tried and what were the results?

Paul

I unfortunately didn't save my IF statements into my program since they weren't working and I had to turn in what I had. However, I may have just found my issue. Again, this is all new to me and I'm basing everything off tutorials. But since I'm wanting to read certain outputs and classify them, should I try to use analog pins rather than digital pins?

maddog859:
I unfortunately didn't save my IF statements into my program since they weren't working and I had to turn in what I had. However, I may have just found my issue. Again, this is all new to me and I'm basing everything off tutorials. But since I'm wanting to read certain outputs and classify them, should I try to use analog pins rather than digital pins?

What analog pins would that be? The amplifier board seems to only have digital output.

Paul

Ah yes, I forgot about that part. So since the amplifier board only has digital output, how could I use that output to classify certain objects? After about 8 pages of previous related forums I found this:

 if (scale.get_units() > 1) {
   digitalWrite(13, HIGH);
    }
  else {
       digitalWrite(13, LOW);
      }

Could I use this and a combination of serial.prints to have the output assign a range of values as a certain name?

You have it all right there in front of you, so why not try it?

Paul