Brendan Leech / Mbed 2 deprecated ThermoCoupleProjectOk

Dependencies:   mbed C12832_lcd

Files at this revision

API Documentation at this revision

Comitter:
brendanmleech
Date:
Thu Jul 30 18:18:42 2020 +0000
Commit message:
ThermoCouple BrendanL t00050766

Changed in this revision

C12832_lcd.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/C12832_lcd.lib	Thu Jul 30 18:18:42 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/dreschpe/code/C12832_lcd/#8f86576007d6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Jul 30 18:18:42 2020 +0000
@@ -0,0 +1,47 @@
+
+#include "mbed.h"
+#include "C12832_lcd.h"
+
+AnalogIn ain(p19);       // ain is an object of class Analogin
+DigitalOut led(LED1);    // led is an object if class Digitalout
+C12832_LCD lcd;          // LCD is an object of class C12832
+float temperature;
+InterruptIn joystickcenter(p14);
+InterruptIn button(p9);
+Timer debounce;
+int i;
+int x;
+
+void flip()  {
+led = !led; // toggles the led when the joystick button is pressed.
+if (debounce.read_ms() > 1000 )
+x = 1;
+debounce.reset();
+}
+
+int main() {
+temperature = ain*600-200;
+        lcd.locate(0,0);
+        lcd.printf("Temperature needs reset");
+
+        if(temperature > 295) {
+            for (i=0;i<60;i++);
+            led=1;
+            wait(0.5);
+        x=1;
+        {
+        wait(0.5);                   //  wait for a half a second
+
+    joystickcenter.rise(&flip); // attach the function address to the rising edge
+    button.mode(PullUp); // With this, no external pullup resistor needed
+    button.rise(&flip); // attach the function address to the rising edge
+        
+        while(1) { // wait around, interrupts will interrupt this!
+        if(x==1){  // set x to 1 in flip() and compare it to 1 (i.e. if x ==1 { ... } )
+        
+        
+   }
+   } 
+}
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Jul 30 18:18:42 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file