Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed C12832 LM75B FatFileSystem MSCFileSystem
Revision 3:9af30b26b6a7, committed 2019-01-23
- Comitter:
- raduschirila
- Date:
- Wed Jan 23 10:28:46 2019 +0000
- Parent:
- 2:c887cf1c3ed9
- Commit message:
- a
Changed in this revision
diff -r c887cf1c3ed9 -r 9af30b26b6a7 C12832.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/C12832.lib Wed Jan 23 10:28:46 2019 +0000 @@ -0,0 +1,1 @@ +http://os.mbed.com/users/chris/code/C12832/#7de323fa46fe
diff -r c887cf1c3ed9 -r 9af30b26b6a7 LM75B.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LM75B.lib Wed Jan 23 10:28:46 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/chris/code/LM75B/#6a70c9303bbe
diff -r c887cf1c3ed9 -r 9af30b26b6a7 main.cpp
--- a/main.cpp Tue Oct 16 15:47:35 2012 +0000
+++ b/main.cpp Wed Jan 23 10:28:46 2019 +0000
@@ -1,23 +1,32 @@
#include "mbed.h"
#include "MSCFileSystem.h"
-
+#include "LM75B.h"
+#include "C12832.h"
MSCFileSystem fs("fs");
DigitalOut led(LED1);
-AnalogIn pot1(p19);
-
+AnalogIn light(p17);
+C12832 lcd(p5, p7, p6, p8, p11);
+LM75B temperature(p28,p27);
+DigitalIn stop(p14);
int main()
{
- FILE *fp = fopen("/fs/test.csv","w");
- printf("Create filehandle for test.csv\n");
-
- printf("Writing to file\n");
- for (int i=0; i<100; i++) {
- fprintf(fp,"%.2f\n",pot1.read());
- wait(0.05);
- led=!led;
- }
-
+ float temp; int x=0;
+ FILE *fp = fopen("/fs/data.csv","w");
+ led=0;
+ do{
+ led=1;
+ temp=temperature.read();
+ lcd.cls();
+ lcd.locate(0,3);
+ lcd.printf("Temperature = %.3f\n Reading: %d", temp,x);
+ fprintf(fp,"%d , %.3f\n",x,temp);
+ led=0;
+ x++;
+ wait(600);
+ }while(!stop);
+
fclose(fp);
- printf("Close the handle\n");
led=1;
-}
\ No newline at end of file
+ wait(1);
+ led=0;
+}