Airio-Base_ADT7410

Dependencies:   ADT7410 SDFileSystem mbed

Files at this revision

API Documentation at this revision

Comitter:
respon
Date:
Fri Feb 23 20:04:23 2018 +0000
Child:
1:adef6ac37387
Commit message:
Airio-Base_ADT7410

Changed in this revision

ADT7410.lib Show annotated file Show diff for this revision Revisions of this file
SDFileSystem.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/ADT7410.lib	Fri Feb 23 20:04:23 2018 +0000
@@ -0,0 +1,1 @@
+http://os.mbed.com/users/tkreyche/code/ADT7410/#e1aee50340ec
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SDFileSystem.lib	Fri Feb 23 20:04:23 2018 +0000
@@ -0,0 +1,1 @@
+http://os.mbed.com/users/mbed_official/code/SDFileSystem/#abfb095fb178
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Feb 23 20:04:23 2018 +0000
@@ -0,0 +1,45 @@
+#include "mbed.h"
+#include "ADT7410.h"
+#include "SDFileSystem.h"
+
+DigitalOut myled(LED1);
+DigitalIn sw1(P1_20);
+DigitalIn sw2(P0_1);
+DigitalOut sd_en(P1_16, 1);
+//DigitalIn sd_dat3(P0_17); // 0x10
+//DigitalIn sd_dat2(P1_22); // 0x08
+//DigitalIn sd_dat1(P1_14); // 0x04
+//DigitalIn sd_dat0(P0_22); // 0x02
+//DigitalIn sd_cmd(P0_21);  // 0x01
+SDFileSystem fs(P0_21, P0_22, P1_15, P0_17, "sd"); // mosi(CMD), miso(DAT0), sclk(CLK), cs(DAT3)
+
+ADT7410 tempSens1(P0_5, P0_4, 0x90, 100000); // sda, scl
+
+char buffer[50];
+
+int main()
+{
+
+    FILE *fp = fopen("/sd/TEST.txt", "w");
+    fprintf(fp, "\n\rHello World!\n\r");
+    fclose(fp);
+    free(fp);
+
+    myled=0;
+    tempSens1.reset();
+    tempSens1.setConfig(ONE_SPS_MODE);
+
+    // get temperature every two seconds
+    while (1) {
+        sprintf (buffer, "%f\r\n", tempSens1.getTemp());
+        FILE *fp = fopen("/sd/TEST.txt", "a");
+        fprintf(fp, buffer);
+        fclose(fp);
+        free(fp);
+        myled=1;
+        wait(0.5);
+        myled=0;
+        wait(0.5);
+    }
+    
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Feb 23 20:04:23 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/5571c4ff569f
\ No newline at end of file