Capture data from ECG shield

Started by diegofpo, December 12, 2017, 06:17:42 am

Previous topic - Next topic

diegofpo

Hey everyone, I'm making a system to save data from ecg shield in a sd card but when I took the saved file and try to plot it I have a lot of noise. I'm using file.write(value) to save data so my code is something like:

for (TxIndex =0; TxIndex<17;TxIndex++)
   Save(TxBuf[TxIndex]);


Can you help Me?  :'(

svan

I'm not sure why you are using a for loop and saving only 16 data points.  I don't have a lot of experience saving ecg data to disk, but the few times that I tried it, I saved every data point followed by a comma, ie comma separated values which may then be uploaded into a spreadsheet and plotted.

void loop()
{
if (micros() > LoopTimer)
{
  LoopTimer += LoopTime;
  sensorValue = analogRead(analogInPin); 
  Serial.println(sensorValue);
  String dataStr = "";
  dataStr += String(sensorValue);
  dataStr += ",";
  dataFile.println(dataStr);   
  dataFile.flush();
  }
}