02/07/15
Dependencies: mbed
Data.cpp@43:8e154016dd89, 2015-07-08 (annotated)
- Committer:
- aidanPJG
- Date:
- Wed Jul 08 15:16:26 2015 +0000
- Revision:
- 43:8e154016dd89
- Parent:
- 42:b9055f46cfed
- Child:
- 44:3b45ec49bc44
datalog working more. Initialisation and then data fill up
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ADAMSTRUTT | 35:085a674c9fdf | 1 | #include "mbed.h" |
ADAMSTRUTT | 35:085a674c9fdf | 2 | |
ADAMSTRUTT | 35:085a674c9fdf | 3 | LocalFileSystem local("local"); |
ADAMSTRUTT | 35:085a674c9fdf | 4 | |
aidanPJG | 43:8e154016dd89 | 5 | void initialise() |
aidanPJG | 43:8e154016dd89 | 6 | { |
aidanPJG | 43:8e154016dd89 | 7 | FILE *fp1 = fopen("/local/Datalog.xls", "a"); // opens or creates fill Datalog, and gives the headings |
aidanPJG | 43:8e154016dd89 | 8 | fprintf(fp1, " Sensor Name \t Time \n"); |
aidanPJG | 43:8e154016dd89 | 9 | fclose(fp1); |
aidanPJG | 43:8e154016dd89 | 10 | } |
aidanPJG | 43:8e154016dd89 | 11 | |
aidanPJG | 43:8e154016dd89 | 12 | void data(int sensor_number, int speed) |
aidanPJG | 43:8e154016dd89 | 13 | { |
aidanPJG | 43:8e154016dd89 | 14 | printf("it be printing"); //testing |
aidanPJG | 42:b9055f46cfed | 15 | |
aidanPJG | 43:8e154016dd89 | 16 | FILE *fp = fopen("/local/Datalog.xls", "a"); // Open "Datalog |
aidanPJG | 43:8e154016dd89 | 17 | fprintf(fp, " %d \t %d \n",sensor_number, speed); //fills the tables with the results |
ADAMSTRUTT | 35:085a674c9fdf | 18 | fclose(fp); |
ADAMSTRUTT | 35:085a674c9fdf | 19 | } |