I am trying to read/write an SD Card. Am having no luck whatsoever...
But my question is specifically, I have gotten some code from two places which has different assignments for the SPI pins. To wit: From http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1290279801
// Ports for Arduino Mega // int PIN_CS = PINB0; // chip select int PIN_MOSI = PINB2; // master out slave in int PIN_MISO = PINB3; // master in slave out int PIN_CLOCK = PINB1; // clock
// Ports int PIN_CS = PINB2; // chip select int PIN_MOSI = PINB3; // master out slave in int PIN_MISO = PINB4; // master in slave out int PIN_CLOCK = PINB5; // clock
Since I am using an Arduino UNO with ATMega328, I should use the second section above, NOT the ones for the Arduino Mega, correct? I guess I was confused at first when I saw the "Mega" I thought it was correct because I was using an AT"Mega". But in composing this post I have discovered there is an Arduino Mega. Ha, I guess I just answered my own question :) But please someone tell me that my answer is correct!! :)