How do I get to record my ppg signal and save the data in csv file in my phone?

Viewed 56

I am a beginner to flutter software and I am using dart language. I can't seem to find any tips that helps me to record ppg signal with a timer and then saving the data in csv file in my vivo phone. I need to save in the csv file so that i can convert it in matlab to analyse it. Whoever knows solution for this, please do answer me... I need to complete my project by today...

1 Answers

You can start by using this tutorial to learn how it works.

https://betterprogramming.pub/measuring-your-heart-rate-using-your-phones-camera-and-flutter-f444d3c4272a

Then you can use a package like csv and convert rows to csv format. Then save it in a file

String csv = const ListToCsvConverter().convert(rows);
String dir = await ExtStorage.getExternalStoragePublicDirectory(
    ExtStorage.DIRECTORY_DOWNLOADS);

String file = "$dir";

File ppgSignals = File(file + "/fileName.csv");

ppgSignals.writeAsString(csv)
Related