I'm currently having a project which reads, voltage and current then computes for power, peak power and total energy consumption of an appliance/s.
One feature of my project is that the user can save and read readings of peak power and total enrgy consumption which is stored in a 1GB micro SD card. The user can save and read the readings anytime he/she wants.
My question is how much can arduino read and write take with this kind of memory and process?
here is my code of how I write and read text in a file.
Write:
int WriteToFile(String text){
if(myFile){
myFile.println(text);
return 1;
}else{
return 0;
}
}
Read:
void Read(){
myFile.seek(0);
char cr;
for(unsigned int i = 0; i < linenumber;){
cr = myFile.read();
if(cr == '\n'){
i++;
}
}
while(true){
cr = myFile.read();
if((cr == '\n')||(cr == '\r')||(cr < 0))
break;
lcd2.print(cr);
}
}
Im using the catalex micro SD card module and Arduino Mega2560 MCU.