Leon Wehmeier / Mbed OS fiasco_max32630

Dependencies:   SoftSerial MAX14690 Buffer

Fork of rtos_threading_with_callback by mbed_example

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers displayData.cpp Source File

displayData.cpp

00001 #include "mbed.h"
00002 #include "Adafruit_SSD1306.h"
00003 #include "rtos.h"
00004 #include "global.h"
00005 
00006 class DisplayData
00007 {
00008 public:
00009     static void run()
00010     {
00011         for (;;) {
00012         
00013             display.clearDisplay();
00014             display.setTextCursor(0,0);
00015             display.printf("T: %3.1f P: %5.0f\n", temperature, pressure);
00016             display.printf("alt: %4.1f h: %3.2f\n", altitude, humidity);
00017             display.printf("ACC1:%2.1f;%2.1f;%2.1f\r\n", (acc1[0]), (acc1[1]), (acc1[2]));
00018             display.printf("ACC2:%2.1f;%2.1f;%2.1f", acc2[0], acc2[1], acc2[2]);
00019             display.display();
00020             rtos::Thread::wait(1500);
00021         }
00022     }
00023     DisplayData()
00024     {
00025         registerThread(DisplayData::run);
00026     }
00027     static Adafruit_SSD1306_I2c display;
00028 };
00029 Adafruit_SSD1306_I2c DisplayData::display(&i2c2);
00030 
00031 // some witchcraft to register run function without touching anything outside our library
00032 static DisplayData _dummy;