for ece4781 project

Dependencies:   HX711 beep mbed

Files at this revision

API Documentation at this revision

Comitter:
jmiller322
Date:
Wed Nov 29 00:26:49 2017 +0000
Commit message:
this is a test

Changed in this revision

HX711.lib Show annotated file Show diff for this revision Revisions of this file
beep.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
diff -r 000000000000 -r d5e36ee82984 HX711.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HX711.lib	Wed Nov 29 00:26:49 2017 +0000
@@ -0,0 +1,1 @@
+http://os.mbed.com/users/megrootens/code/HX711/#16627e96c8de
diff -r 000000000000 -r d5e36ee82984 beep.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/beep.lib	Wed Nov 29 00:26:49 2017 +0000
@@ -0,0 +1,1 @@
+http://os.mbed.com/users/dreschpe/code/beep/#d8e14429a95f
diff -r 000000000000 -r d5e36ee82984 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Nov 29 00:26:49 2017 +0000
@@ -0,0 +1,36 @@
+#include "mbed.h"
+#include "Hx711.h"
+#include "beep.h"
+
+Beep buzzer(p21);
+//DigitalOut led(LED1);
+DigitalOut led4(LED4);
+Hx711 pressure(p7, p5, 0, 0.005, 128);
+Serial pc(USBTX, USBRX);    // USB Serial Terminal
+
+int main(void)
+{
+    float val2 = pressure.read();
+    float ref = pressure.read();
+    while (true) {
+        float val = pressure.read();
+        int checkPlus = val*0.05 + val;
+        int checkMinus = val - val*0.05;
+        if(!((val2 < checkPlus) && (val2 > checkMinus))) {
+            //pc.printf("%.2f\r\n", val);
+            if(val > (ref*.5)) {
+                //pc.printf("Check Your Form!! Too much pressure on the underarms.\r\n");
+                buzzer.beep(1000, 1.0);
+                led4 = !led4;
+                wait(1.0f);
+            }
+            val2 = val;
+        }
+        //led = !led; // toggle led
+        if(led4 == 1) {
+            led4 = !led4;
+        }
+        wait(0.2f);
+    }
+
+}
diff -r 000000000000 -r d5e36ee82984 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Nov 29 00:26:49 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e7ca05fa8600
\ No newline at end of file