Final code for paint dispensing Machine

Dependencies:   mbed C12832

Files at this revision

API Documentation at this revision

Comitter:
vmg
Date:
Fri Jul 31 16:08:20 2020 +0000
Commit message:
Final code for Paint Dispensing machine Project

Changed in this revision

C12832.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 f58752ef18dd C12832.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/C12832.lib	Fri Jul 31 16:08:20 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/askksa12543/code/C12832/#990d5eec2ef6
diff -r 000000000000 -r f58752ef18dd main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Jul 31 16:08:20 2020 +0000
@@ -0,0 +1,38 @@
+// Pot1 controls the paint pump which controls the panit flow rate
+// Pot2 controls the speed of stepper motor of the axis
+
+
+#include "C12832.h"
+#include "mbed.h"
+C12832 lcd(p5,p7,p6,p8,p11); 
+PwmOut led1(LED1);
+AnalogIn pot1(p19);
+PwmOut led4(LED4);
+AnalogIn pot2(p20);
+BusIn joy(p16,p13);
+DigitalIn fire(p14);
+
+BusOut leds(LED2,LED3); 
+
+int main()
+{ 
+while(1) 
+{
+    if (fire) {
+            leds=0xf;
+        } else {
+            leds=joy;
+        }
+
+lcd.locate(0,0); //keeps the output to lcd display in the same position each print
+lcd.printf("Pot 1 Paint flow rate %.2f",pot1.read()); //shows setting for pot1 - paint flow rate and sends message to lcd screen
+lcd.printf("  Pot 2 Axis Speed %.2f",pot2.read());  //shows setting for pot2 - axis speed - and sends message to lcd screen
+
+led1 = pot1; //led1 is the output and controlled by pot1 and represents the Paint flow rate
+led4 = pot2; //led2 is the output controlled by pot2 and represents the axis speed
+wait(0.01); // the instruction to wait 0.01 of a second
+
+}
+}
+
+
diff -r 000000000000 -r f58752ef18dd mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Jul 31 16:08:20 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file