a

Dependencies:   LM75B mbed

Files at this revision

API Documentation at this revision

Comitter:
bulmenwt
Date:
Wed Jan 28 07:53:17 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 82a867b41ac6 LM75B.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LM75B.lib	Wed Jan 28 07:53:17 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/neilt6/code/LM75B/#7ac462ba84ac
diff -r 000000000000 -r 82a867b41ac6 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jan 28 07:53:17 2015 +0000
@@ -0,0 +1,55 @@
+/*M0-BOARD LPC11U24 VERSION 1.0 WF 01_2015
+BULME Graz / Elektronik
+RGB - LED
+Datei: WF_RGB_Taster_V3/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 !
+
+// Funktions-Prototype
+//Bei einer Funktionsdeklaration wird nur der Funktionskopf 
+//gefolgt von einem Semikolon angeben
+void farbe(int gruen, int blau, int rot);
+
+int main()
+{
+    int code;
+    while(1)
+    {       
+    code = (sw3 * 4) + (sw2 * 2) + (sw1); //binary encoded buttons
+    switch (code) {
+            case 1:
+                farbe(0,1,1);
+                break;
+                
+            case 2:
+                farbe(1,0,1);
+                break;
+                
+            case 4:
+                farbe(1,1,0);
+                break;   
+                
+            default:
+                farbe(1,1,1);
+                break;
+            }          
+    }    
+}
+
+// Function farbe definieren
+void farbe(int gruen, int blau, int rot)
+{
+    g=gruen; // LED gruen  
+    b=blau; // LED blau
+    r=rot; // LED rot
+   
+} 
diff -r 000000000000 -r 82a867b41ac6 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jan 28 07:53:17 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1
\ No newline at end of file