a

Dependencies:   LM75B mbed

Files at this revision

API Documentation at this revision

Comitter:
bulmenwt
Date:
Wed Jan 28 07:52:24 2015 +0000
Commit message:
a

Changed in this revision

LM75B.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 c96b6773ab09 LM75B.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LM75B.lib	Wed Jan 28 07:52:24 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/neilt6/code/LM75B/#7ac462ba84ac
diff -r 000000000000 -r c96b6773ab09 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jan 28 07:52:24 2015 +0000
@@ -0,0 +1,71 @@
+/*M0-BOARD LPC11U24 VERSION 1.0 WF 01_2015
+BULME Graz / Elektronik
+RGB - LED
+Datei: WF_RGB_Ampel/main.cpp
+*/
+
+#include "mbed.h"
+PwmOut g(p5); // Definition LED grün, PWM
+PwmOut b(p34); // Definition LED blau, PWM
+PwmOut r(p36); // Definition LED rot, PWM
+
+// Definition der Taster (Switches)
+DigitalIn  sw1(P0_15);  // SW1 -> sein IO Pin ist laut Schaltplan der P0_15
+DigitalIn  sw2(P0_10);  // Die Pins werden hier mit DigitalIn belegt ! 
+DigitalIn  sw3(P0_23);  // Die Pins werden hier mit DigitalIn belegt !
+
+// definition der Zustände
+typedef enum { a_rot, a_blau, a_gruen, temp} state_t ;
+state_t state = a_rot;
+
+// Funktions-Prototype
+void farbe(int gruen, int blau, int rot);
+void stateMachine();
+
+int main()
+{
+    farbe(1,1,0);
+    while(1)
+    {       
+      if (sw1==1) {
+          stateMachine();
+      }    
+    }
+}  
+    
+// Function farbe definieren
+void farbe(int gruen, int blau, int rot)
+{
+    g=gruen; // LED gruen  
+    b=blau; // LED blau
+    r=rot; // LED rot
+} 
+
+// Function Zustnadsmaschine
+void stateMachine()
+{
+    switch( state ) {
+        case a_rot:
+            farbe(1,1,0);
+            wait(2);
+            state = a_blau;
+            //break;
+            
+        case a_blau:
+            farbe(1,0,1);
+            wait(2);
+            state = a_gruen;
+            //break;
+            
+        case a_gruen:
+            farbe(0,1,1);
+            wait(2);
+            state = a_rot;
+            //break;  
+            
+        case temp:
+            farbe(1,1,0);
+            break; 
+              
+    }
+}
diff -r 000000000000 -r c96b6773ab09 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jan 28 07:52:24 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1
\ No newline at end of file