Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

loadcell

loadcell2

1 void setup() {
2 Serial.begin(9600); //start the serial connection with the computer
3
4 pinMode (A0, INPUT); //output from the amplifier will be connected to this pin
5
6 }
7
8 void loop()
9
10 {
11 float offset = 309.71;
12
13 float sensitivity=1.5262;
14
15
16 int AnalogValue = analogRead(A0); //Read the input on A0
17
18 Serial.print("Analog Value: ");
19
20 Serial.println(AnalogValue); //print the input value
21
22
23 float DigitalValue = (AnalogValue-offset)/sensitivity;
24
25 Serial.print("weight value ");
26
27 Serial.println(DigitalValue); // voltage value
28
29
30 delay(5000);
31
32 }
33

/
/

You might also like