Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arduino for Secret Agents

You're reading from  Arduino for Secret Agents

Product type Book
Published in Nov 2015
Publisher
ISBN-13 9781783986088
Pages 170 pages
Edition 1st Edition
Languages
Concepts
Author (1):
Marco Schwartz Marco Schwartz
Profile icon Marco Schwartz

Table of Contents (16) Chapters

Arduino for Secret Agents
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
A Simple Alarm System with Arduino Creating a Spy Microphone Building an EMF Bug Detector Access Control with a Fingerprint Sensor Opening a Lock with an SMS Building a Cloud Spy Camera Monitoring Secret Data from Anywhere Creating a GPS Tracker with Arduino Building an Arduino Spy Robot Index

Using the SD card


The first thing that we are going to do in this project is to test whether we can actually access the SD card. This will ensure that we don't run into SD card-related problems later in the project.

This is a picture of the Ethernet Shield that I used, with the microSD card mounted on the right:

Let's now see the code that we will use to test the SD card's functionalities. The following is the complete code for this section:

// Include the SD library
#include <SPI.h>
#include <SD.h>

// Set up variables using the SD utility library functions:
Sd2Card card;
SdVolume volume;
SdFile root;

// change this to match your SD shield or module;
// Arduino Ethernet shield: pin 4
// Adafruit SD shields and modules: pin 10
// Sparkfun SD shield: pin 8
const int chipSelect = 4;

void setup()
{
  // Open serial communications and wait for port to open:
  Serial.begin(115200);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }


  Serial...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}