background image

 

 

 

 

 5 

 

Example 

 

 

/* 

 

  SD card test 

 

 

 

  This example shows how use the utility libraries on which the' 

 

  SD library is based in order to get info about your SD card. 

 

  Very useful for testing a card when you're not sure whether its working or not. 

 

 

 

  The circuit: 

 

    SD card attached to SPI bus as follows: 

 

 ** MOSI - pin 11 on Arduino Uno/Duemilanove/Diecimila 

 

** MISO - pin 12 on Arduino Uno/Duemilanove/Diecimila 

 

 ** CLK - pin 13 on Arduino Uno/Duemilanove/Diecimila 

 

 ** CS - depends on your SD card shield or module. 

 

  

 

 

 

 

 

  created  28 Mar 2011 

 

  by Limor Fried 

 

  modified 9 Apr 2012 

 

  by Tom Igoe 

 

  modified 4 Sept 2020 

 

  by Midas Gossye (Velleman) 

 

*/ 

 

// 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 

 

// Velleman VMA304/WPSH304 & Adafruit SD shields and modules: pin 10 

 

// Sparkfun SD shield: pin 8 

 

// MKRZero SD: SDCARD_SS_PIN 

 

const int chipSelect = 10; 

 

 

 

void setup() { 

 

  // Open serial communications and wait for port to open: 

 

  Serial.begin(9600); 

 

  while (!Serial) { 

 

    ; // wait for serial port to connect. Needed for native USB port only 

 

  } 

 

 

 

 

 

  Serial.print("\nInitializing SD card..."); 

Содержание Whadda WPI304

Страница 1: ...USER MANUAL EN SD card logging module for Arduino WPI304 whadda com...

Страница 2: ...ons with reduced physical sensory or mental capabilities or lack of experience and knowledge if they have been given supervision or instruction concerning the use of the device in a safe way and under...

Страница 3: ...n Wiring and the Arduino software IDE based on Processing Additional shields modules components are required for reading a twitter message or publishing online Surf to www arduino cc for more informat...

Страница 4: ...4 Connection Connection to Arduino Uno Arduino WPI304 10 CS 11 MOSI 12 MISO 13 SCK GND GND 5V 5 V Connection to Arduino Mega Arduino WPI304 50 MISO 51 MOSI 52 SCK 53 CS GND GND 5V 5 V...

Страница 5: ...reated 28 Mar 2011 by Limor Fried modified 9 Apr 2012 by Tom Igoe modified 4 Sept 2020 by Midas Gossye Velleman include the SD library include SPI h include SD h set up variables using the SD utility...

Страница 6: ...YPE_SD1 Serial println SD1 break case SD_CARD_TYPE_SD2 Serial println SD2 break case SD_CARD_TYPE_SDHC Serial println SDHC break default Serial println Unknown Now we will try to open the volume parti...

Страница 7: ...locks are 1KB Serial print Volume size Kb Serial println volumesize Serial print Volume size Mb volumesize 1024 Serial println volumesize Serial print Volume size Gb Serial println float volumesize 10...

Страница 8: ...8 whadda com Modifications and typographical errors reserved Velleman Group nv WPI304_v01 Velleman Group nv Legen Heirweg 33 9890 Gavere...

Отзывы: