Connecting a uMMC to an Arduino Mega

Here is an example of how to connect a uMMC to an Arduino Mega.

Connections

First, connect the uMMC to the Arduino Mega.

uMMC Arduino Mega
+ (V) 5V (Power connector)
G (either one) GND (Power connector)
T (Transmit) Pin 19 (RX1)
R (Receive) Pin 18 (TX1)

uMMC connected to Arduino Mega

Install The RogueSD Library

Next, install the RogueSD library.

Example Sketch

And now a simple sketch to test it out. Pins 18 and 19 correspond to Serial1 on the Arduino Mega.

ummc_mega_example.pde
#include <RogueSD.h>
 
RogueSD ummc(Serial1);
 
void setup()
{
  int8_t filehandle;
 
  Serial.begin(9600);
 
  Serial1.begin(9600);
 
  // this just makes sure we have a nice random number later
  randomSeed(analogRead(0));
 
  // prepare the communications with the uMMC and closes all open files (if any)
  ummc.sync();
 
  // open a file (append data)
  filehandle = ummc.open("/filetest.txt", OPEN_APPEND);
 
  if(filehandle > 0)
  {
    Serial.println("File opened.");
 
    // append some data
    ummc.writeln_prep(filehandle);
 
    // you can use any of the standard print methods to send data to the file.
    ummc.print("You'll see this many times in this file. RAND: ");
    ummc.print(random(10000));
    ummc.writeln_finish();
 
    Serial.println("Append complete.");
 
    ummc.close(filehandle);
 
    Serial.println("File closed.");
  }
  else
  {
    Serial.print("ERROR: ");
    Serial.println(ummc.LastErrorCode, HEX);
  }
}
 
void loop()
{
}
You could leave a comment if you were logged in.
  • Bookmark at
  • Bookmark "Connecting a uMMC to an Arduino Mega" at del.icio.us
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Digg
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Google
  • Bookmark "Connecting a uMMC to an Arduino Mega" at StumbleUpon
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Technorati
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Facebook
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Twitter
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Slashdot
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Yahoo! Bookmarks
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Furl
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Reddit
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Ask
  • Bookmark "Connecting a uMMC to an Arduino Mega" at BlinkList
  • Bookmark "Connecting a uMMC to an Arduino Mega" at blogmarks
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Ma.gnolia
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Netscape
  • Bookmark "Connecting a uMMC to an Arduino Mega" at ppnow
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Rojo
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Shadows
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Simpy
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Socializer
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Spurl
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Tailrank
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Live Bookmarks
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Wists
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Yahoo! Myweb
  • Bookmark "Connecting a uMMC to an Arduino Mega" at BobrDobr
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Memori
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Faves
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Favorites
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Newsvine
  • Bookmark "Connecting a uMMC to an Arduino Mega" at myAOL
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Fark
  • Bookmark "Connecting a uMMC to an Arduino Mega" at RawSugar
  • Bookmark "Connecting a uMMC to an Arduino Mega" at LinkaGoGo
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Mister Wong
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Wink
  • Bookmark "Connecting a uMMC to an Arduino Mega" at BackFlip
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Diigo
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Segnalo
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Netvouz
  • Bookmark "Connecting a uMMC to an Arduino Mega" at DropJack
  • Bookmark "Connecting a uMMC to an Arduino Mega" at Feed Me Links
  • Bookmark "Connecting a uMMC to an Arduino Mega" at funP
  • Bookmark "Connecting a uMMC to an Arduino Mega" at HEMiDEMi
code/ummc_on_an_arduino_mega.txt · Last modified: 2009/12/06 02:04 by bhagman
Valid CSS Recent changes RSS feed Valid XHTML 1.0