Hardware Reference
In-Depth Information
}
else
{
Serial.println("Couldn't open log file");
}
delay(refresh_rate);
}
When you now run this program, data should be written at the rate you
specify. Looking at the serial terminal confirms this (see FigureĀ 13-17).
Figure 13-17: Data logging at rate specified by the command file
UsingaReal-TimeClock
Nearly every data logging application will benefit from the use of a real-time
clock. Using a real-time clock within your system allows you to timestamp
measurements so that you can more easily keep track of when certain events
occurred. In the previous section, you simply used the millis() function to
keep track of the time elapsed since the Arduino turned on. In this section, you
use a dedicated real-time clock integrated circuit to keep accurate time so that
when you save data to the SD card it corresponds to the time the data was taken.
 
Search WWH ::




Custom Search