Steven Kay / Mbed 2 deprecated Embedded_Software_Assignment_2

Dependencies:   MCP23017 SDFileSystem WattBob_TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
sk398
Date:
Mon Feb 15 21:56:19 2016 +0000
Child:
1:221d677fe0d3
Commit message:
All tasks implemented as classes and in a single file.; ; Task3 is fnished; All others are not

Changed in this revision

Tasks.cpp Show annotated file Show diff for this revision Revisions of this file
Tasks.h 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/main.cpp	Mon Feb 15 21:56:19 2016 +0000
@@ -0,0 +1,85 @@
+#include "mbed.h"
+
+#define WATCHDOG_PULSE_WIDTH 15
+
+class Task1 // Square Wave Reader - read every second
+{
+    
+public:
+    Task1::Task1(PinName squareWaveInPin)
+    {
+        Timer Task1Timer;
+        _squareWaveIn = new DigitalIn(squareWaveInPin);
+    }
+    
+    int Task1::MeasureFreq()
+    {
+        
+        
+    }
+        
+    
+private:
+
+    DigitalIn *_squareWaveIn;
+};
+
+class Task2 // Digital Input Reader - Read every 300ms
+{
+public:
+    Task2::Task2()
+    {
+        
+    }
+        
+private:
+  
+};
+
+class Task3 //  Watchdog Pulse - output every 300ms
+{
+public:
+    Task3::Task3(WatchdogPin)
+    {
+        _Watchdog = new DigitalOut(WatchdogPin)
+    }
+    
+    Task3::OutputWatchdogPulse()
+    {
+        _Watchdog -> write(HIGH);
+        wait_ms(WATCHDOG_PULSE_WIDTH);
+        _Watchdog -> wirte(LOW);
+    }
+        
+private:
+    DigitalOut *_Watchdog;
+  
+};
+
+class Task4 //  Read Analogue inputs - read every 400ms
+{
+public:
+    Task4::Task4()
+    {
+        
+    }
+        
+private:
+  
+};
+
+DigitalOut myled(LED1);
+
+Task1 task1(p5); // Square wave Measurement
+
+Task2 task3(p6); // Watchdog Pulse
+
+
+int main() {
+    while(1) {
+        myled = 1;
+        wait(0.2);
+        myled = 0;
+        wait(0.2);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Feb 15 21:56:19 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/f141b2784e32
\ No newline at end of file