Team DIANA
/
ScientificGara
pseudo-code scientific gara
Revision 0:9e66b8d2ee5a, committed 2019-09-11
- Comitter:
- Alessio_Zaino
- Date:
- Wed Sep 11 10:26:24 2019 +0000
- Commit message:
- scientific gara
Changed in this revision
diff -r 000000000000 -r 9e66b8d2ee5a HX711.lib --- /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
diff -r 000000000000 -r 9e66b8d2ee5a main.cpp --- /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
diff -r 000000000000 -r 9e66b8d2ee5a mbed.bld --- /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