I am trying to get a txt file of the data from all four sensors to the SD card. It works when I use the first code for the DHT sensor only, the data is recorded inside the SD card as a txt file and I can open it when I connect the SD card into my laptop to see the contents of it. I use this
to record all the data from the four sensors which is the second code I uploaded here and it does not work. A txt file is not created, and no data is collected. The code itself works. I can replace the “sensorsdata” with “Serial” instead, and it does display the data of the sensors in the monitor. But the code to make the txt file and place all the data of the four sensors in the SD card does not work.