pseudo-code scientific gara

Dependencies:   mbed HX711

Files at this revision

API Documentation at this revision

Comitter:
Alessio_Zaino
Date:
Wed Sep 11 10:26:24 2019 +0000
Commit message:
scientific gara

Changed in this revision

HX711.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HX711.lib	Wed Sep 11 10:26:24 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/Volt72/code/HX711/#5d57c2060e7b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Sep 11 10:26:24 2019 +0000
@@ -0,0 +1,66 @@
+#include "mbed.h"
+#include "HX711.h"
+ PwmOut servo1(D3);
+  PwmOut servo2(D5);
+   PwmOut servo3(D6);
+
+ 
+HX711 Balance1(D7,D13);       // Declaration
+HX711 Balance2(D8,D13);       // Declaration
+HX711 Balance3(D9,D13);       // Declaration
+ 
+int main() 
+{
+    
+    
+    long value1,value2,value3;
+    float weight,weight2,weight3;
+        servo1.period(0.02f);
+        servo2.period(0.02f);
+        servo3.period(0.02f);
+                    
+    while (true) 
+    {
+                
+                
+                if(SEGNALE PER SCATOLA1){
+                    servo1.pulsewidth(2200/1000000.0);//chiude box 1
+                    value1 = Balance1.averageValue(100);
+                    weight = (value1-11669475)/2450.0;         // I had to use the 788 value after testing with weight
+                    //INVIARE WEIGHT
+                    
+                    
+                    
+                    
+                    
+                    }
+                    
+                    
+                    
+                    if(SEGNALE SCATOLA2){
+                        servo2.pulsewidth(2100/1000000.0);//chiude box 2
+                        value2 = Balance2.averageValue(100); 
+                        weight2 = (value2-8506861)/940.0;   
+                        
+                        
+                        
+                        
+                        }
+                        
+                        
+                        
+                    if(SEGNALRE SCATOLA3){
+                        servo3.pulsewidth(2200/1000000.0);//chiude box 3
+                        value3 = Balance3.averageValue(100);
+                        weight3 = (value3-9923525)/1800.0;        
+ 
+                        
+                        
+                        
+                        
+                        }
+                   
+}
+    
+}
+ 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Sep 11 10:26:24 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file