Dimmerschaltung für Lab_2

Dependencies:   C12832_lcd LCD_fonts mbed

Files at this revision

API Documentation at this revision

Comitter:
Shadow
Date:
Tue Apr 23 23:31:51 2013 +0000
Child:
1:abdbb6ca745b
Commit message:
Eventuell fertiger Dimmer

Changed in this revision

C12832_lcd.lib Show annotated file Show diff for this revision Revisions of this file
LCD_fonts.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	Tue Apr 23 23:31:51 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/dreschpe/code/C12832_lcd/#c9afe58d786a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LCD_fonts.lib	Tue Apr 23 23:31:51 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/dreschpe/code/LCD_fonts/#d0b7d7bf1f56
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Apr 23 23:31:51 2013 +0000
@@ -0,0 +1,54 @@
+#include "mbed.h"
+#include "C12832_lcd.h"
+#include "Arial_9.h"
+
+C12832_LCD lcd;
+DigitalIn t_left(p13);
+DigitalIn t_right(p16);
+DigitalIn t_on_off(p14);
+PwmOut led(LED1);
+//DigitalOut ledright(LED4);
+
+double i=0.0;
+
+
+int main() {
+    lcd.cls();
+    lcd.set_font((unsigned char*) Arial_9);
+    
+    led=0.0;
+               
+    while (1) {
+    
+    
+    
+    while(t_right&&i<=1.0){
+        lcd.printf("DIMM %lf\n",i);
+        lcd.printf("LED %lf\n",led);  
+        i+=0.01;
+        led=i;
+        wait(0.1);
+        if(!t_right){
+        led=i;
+        lcd.printf("DIMM %lf\n",i);
+        lcd.printf("LED %lf\n",led);    
+                    }
+                 }
+                 
+                 
+    
+    while(t_left&&i>=0.0){                 
+        lcd.printf("DIMM %lf\n",i);
+        lcd.printf("LED %lf\n",led);  
+        i-=0.01;
+        led=i;
+        wait(0.1);
+        if(!t_left){
+        led=i;
+        lcd.printf("DIMM %lf\n",i);
+        lcd.printf("LED %lf\n",led);    
+                    }
+                 }
+            }
+  }
+               
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Apr 23 23:31:51 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/7e6c9f46b3bd
\ No newline at end of file