a demo code to use Seeed SD Card shield V4.0 with Seeeduino-Arch or Seeeduino-Arch-Pro
Dependencies: SDFileSystem mbed
Fork of SDFileSystem_HelloWorld by
Revision 3:47f18e0357e4, committed 2014-02-16
- Comitter:
- lawliet
- Date:
- Sun Feb 16 03:47:41 2014 +0000
- Parent:
- 2:86a01df5c8ac
- Commit message:
- version 0.1
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 86a01df5c8ac -r 47f18e0357e4 main.cpp --- a/main.cpp Mon Feb 10 09:53:52 2014 +0000 +++ b/main.cpp Sun Feb 16 03:47:41 2014 +0000 @@ -19,6 +19,7 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + #include "mbed.h" #include "SDFileSystem.h" @@ -30,26 +31,23 @@ used any more! pin match is as follow. Have fun! */ -//#define SEEEDUINO_ARCH -#define SEEEDUINO_ARCH_PRO - -#if defined(SEEEDUINO_ARCH) -#define PIN_MOSI P1_22 -#define PIN_MISO P1_21 -#define PIN_SCK P1_20 -//#define PIN_CS P1_23 -#define PIN_CS P1_18 -#elif defined(SEEEDUINO_ARCH_PRO) -#define PIN_MOSI P0_18 -#define PIN_MISO P0_17 -#define PIN_SCK P0_15 -//#define PIN_CS P0_16 -#define PIN_CS P2_2 -#else -#define PIN_MOSI P1_22 -#define PIN_MISO P1_21 -#define PIN_SCK P1_20 -#define PIN_CS P1_23 +#if defined(TARGET_LPC11U24) //SEEEDUINO_ARCH + #define PIN_MOSI P1_22 + #define PIN_MISO P1_21 + #define PIN_SCK P1_20 + //#define PIN_CS P1_23 + #define PIN_CS P1_18 +#elif defined(TARGET_LPC1768) //SEEEDUINO_ARCH_PRO + #define PIN_MOSI P0_18 + #define PIN_MISO P0_17 + #define PIN_SCK P0_15 + //#define PIN_CS P0_16 + #define PIN_CS P2_2 +#else //please redefine the following pins. + #define PIN_MOSI + #define PIN_MISO + #define PIN_SCK + #define PIN_CS #endif SDFileSystem sd(PIN_MOSI, PIN_MISO, PIN_SCK, PIN_CS, "sd"); // MOSI, MISO, SCK, CS