USB Host that compiles on mine. If it still does not compile on uni computers, IT S ON THEM
Dependencies: mbed C12832 LM75B FatFileSystem MSCFileSystem
main.cpp
- Committer:
- raduschirila
- Date:
- 2019-01-23
- Revision:
- 3:9af30b26b6a7
- Parent:
- 2:c887cf1c3ed9
File content as of revision 3:9af30b26b6a7:
#include "mbed.h" #include "MSCFileSystem.h" #include "LM75B.h" #include "C12832.h" MSCFileSystem fs("fs"); DigitalOut led(LED1); AnalogIn light(p17); C12832 lcd(p5, p7, p6, p8, p11); LM75B temperature(p28,p27); DigitalIn stop(p14); int main() { 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); led=1; wait(1); led=0; }