user58805: i want to apply formula. but getting 0 at output.

#include "HX711.h"
int data;
HX711 scale(A1, A0);		// parameter "gain" is ommited; the default value 128 is used by the library

void setup() {
  Serial.begin(38400);

  scale.set_scale(2280.f);                 
  scale.tare();				      

}

void loop() {
  Serial.print("one reading:\t");
  data==(scale.get_units()/10);
  Serial.println(data);


		        // put the ADC in sleep mode
  delay(500);

}



user4143: It's zero because you never assign it a value.
Here you are comparing the current value of data (0) with the results of your calculation:
data==(scale.get_units()/10);

I think you intended to use the assignment, not comparison, operator =:
data = (scale.get_units()/10);


58805: <p>i want to apply formula. but getting 0 at output.</p>

<pre>
#include &#34;HX711.h&#34;
int data;
HX711 scale(A1, A0);&#09;&#09;&#47;&#47; parameter &#34;gain&#34; is ommited; the default value 128 is used by the library

void setup() {
 &nbsp;<b>Serial</b>.begin(38400);

 &nbsp;scale.set_scale(2280.f); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 &nbsp;scale.tare();&#09;&#09;&#09;&#09; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

}

void loop() {
 &nbsp;<b>Serial</b>.print(&#34;one reading:\t&#34;);
 &nbsp;data==(scale.get_units()&#47;10);
 &nbsp;<b>Serial</b>.println(data);


&#09;&#09; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#47;&#47; put the ADC in sleep mode
 &nbsp;delay(500);

}

</pre>
 4143: <p>It's zero because you never assign it a value.</p>

<p>Here you are comparing the current value of <code>data</code> (0) with the results of your calculation:</p>

<pre><code>data==(scale.get_units()/10);
</code></pre>

<p>I think you intended to use the assignment, not comparison, operator <code>=</code>:</p>

<pre><code>data = (scale.get_units()/10);
</code></pre>
