-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestRecipes.ino
41 lines (31 loc) · 1006 Bytes
/
TestRecipes.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "TestRecipes.h"
IO * myIO; //The exact IO routines depend on defined(SD) or defined(stdio)
recipes * myrecipes; //Defintion of recipe file
int main(){
//myIO.serialPrintln((char*)"TestRecipes, expects RECIPES.CSV in current directory");
/* check if Recipes file exists */
char filename[] = "/RECIPES.CSV";
myIO = new IO(filename);
bool check = myIO->checkFile(filename);
if(!check){
myIO->serialPrintln((char*)"Failed to open file for writing recipes file");
return 0;
}
/* Read file contents character by character and display on command
line or serial monitor */
//while(myIO->recipeFileavailable())
//{
//myIO->serialPrint((char*)myIO->recipeFileread());
//}
/* Read Recipes from file */
int numRecipes= myrecipes->LoadRecipes();
myIO->serialPrint((char*)"Number of recipes found : ");
myIO->serialPrintln(numRecipes+1);
myIO->recipeFileclose();
}
void setup(){
myIO->initSerial();
main();
}
void loop(){
}