Try the following
Now let us perform some exciting exercises for a better understanding of what we have learnt so far.
- Refer to the Chapter 3, Day 1 - Building a Simple Prototype; add an external LED to the circuit via a digital pin.
- Modify the sketch and make the external LED also blink along with sounding the buzzer.
- Modify the sketch, to perform the buzzing and blinking using a
forloop. - In the SD card example, try creating two log files instead of only one
datalog.txt. One file should be calledcritical.txtand should log events where the A5 pin reading is above 500. While all other readings should continue to get logged in the existingdatalog.txtfile.
- Write a sketch to list the contents of an existing file by adding the following function in the sketch. You can invoke this function by using a function call such as
readFullFile("datalog.txt")from theloop()function of the sketch:
void readFullFile(String fileName)
{
// This function will read and display the
// file contents in...