KEIS

Dependencies:   C12832_lcd mbed-rtos mbed

Fork of rtos_mail by mbed official

Files at this revision

API Documentation at this revision

Comitter:
khayakawa
Date:
Wed Sep 25 05:12:23 2013 +0000
Parent:
3:a3428581e64c
Commit message:
KEIS

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-rtos.lib 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	Wed Sep 25 05:12:23 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/dreschpe/code/C12832_lcd/#468cdccff7af
--- a/main.cpp	Tue Jun 04 16:02:29 2013 +0100
+++ b/main.cpp	Wed Sep 25 05:12:23 2013 +0000
@@ -1,23 +1,28 @@
 #include "mbed.h"
 #include "rtos.h"
+#include "C12832_lcd.h"
+
+C12832_LCD lcd;
 
 /* Mail */
 typedef struct {
-  float    voltage; /* AD result of measured voltage */
-  float    current; /* AD result of measured current */
-  uint32_t counter; /* A counter value               */
+  float    temp;
+  float    humid; 
+  float    illumi;
+  // uint32_t  count; 
 } mail_t;
 
 Mail<mail_t, 16> mail_box;
 
 void send_thread (void const *args) {
-    uint32_t i = 0;
+   uint32_t count= 0;
     while (true) {
-        i++; // fake data update
+        count++; // fake data update
         mail_t *mail = mail_box.alloc();
-        mail->voltage = (i * 0.1) * 33; 
-        mail->current = (i * 0.1) * 11;
-        mail->counter = i;
+        mail->temp = ( count * 0.1) * 30; 
+        mail->humid = (count * 0.1) * 50;
+        mail->illumi = (count * 0.1) * 50;
+       // mail->count = count;
         mail_box.put(mail);
         Thread::wait(1000);
     }
@@ -30,9 +35,10 @@
         osEvent evt = mail_box.get();
         if (evt.status == osEventMail) {
             mail_t *mail = (mail_t*)evt.value.p;
-            printf("\nVoltage: %.2f V\n\r"   , mail->voltage);
-            printf("Current: %.2f A\n\r"     , mail->current);
-            printf("Number of cycles: %u\n\r", mail->counter);
+            lcd.printf("temp: %.2f \n\r"   , mail->temp);
+            lcd.printf("humid: %.2f \n\r"     , mail->humid);
+            lcd.printf("illumination: %.2f \n\r"     , mail->illumi);
+           // lcd.printf("Number of cycles: %u\n\r", mail->counter);
             
             mail_box.free(mail);
         }
--- a/mbed-rtos.lib	Tue Jun 04 16:02:29 2013 +0100
+++ b/mbed-rtos.lib	Wed Sep 25 05:12:23 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed-rtos/
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed-rtos/#58b30ac3f00e
--- a/mbed.bld	Tue Jun 04 16:02:29 2013 +0100
+++ b/mbed.bld	Wed Sep 25 05:12:23 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/b3110cd2dd17
\ No newline at end of file