I am trying to store data from an analog light sensor to an sd card at an interval. By referring to this tutorial (Particle electron SD card problem [SDFAT library]) I think I was able to get the sd card to work? I tested on the program tryMeFirst from the sdfat library, with the following output
So I think my sdcard works. But I don’t know how to approach logging the data from my light sensor (analog read from pin B5, 3.3V connection, and GND connection) onto the sd card. I looked at some other examples in the sdfat library, but it’s kind of overwhelming. In the loop, I’d like the sensor to gather data, then have it store the data to the sd card. then possibly introduce a delay for a period of time, and have the process repeat. This is what I’ve coded so far. The light sensor data is being read and outputted on the serial monitor, but no file is being created… Any advice?
P.S. For the following code, even the light data is not read on read