After uploading, take a look at the PWR LEDs on the Function Boards. The LEDs will be on for about 5 seconds
and then turn off for another 5 seconds. It will continue to repeat until power is removed from the MicroMod Main
Board - Double.
Example 3: Reading and Writing to a MicroSD Card
Note:
For the MicroMod Teensy, make sure to check out the SdFat library included with the Teensyduino
add-on. You'll need to modify the macro's value for the CS pin for the microSD card from:
#define SD_CS_PIN SS
To one of the following values.
//TEENSY
#define SD_CS_PIN 5 // The microSD Card CS pin is D1 for the MicroMod Main Board - Single a
nd Teensy Processor (5). Adjust for your processor if necessary.
//#define SD_CS_PIN 44 // The microSD Card's CS pin is G4 for the MicroMod Main Board - Dou
ble and Teensy Processor (44). Adjust for your processor if necessary.
The example below uses the built-in SD Arduino library. The only difference in the code is the CS pin for the
microSD card, which you will need to adjust for your processor board (in this case we use the Artemis Processor
Board). Make sure to reference your Processor Board's CS pin for either the Main Board - Single (D1) or Main
Board - Double (G4).
Note:
The SPI pins will be defined as macros with your processor's board definitions so we won't need to
define COPI, CIPO, or CLK pins. Sweet!
If you have not already, select your Board (in this case the
MicroMod Artemis
), and associated COM port. Copy
and paste the code below in your Arduino IDE. Hit the upload button and set the serial monitor to
9600
baud.