If you edit Sd2Card.h so the // is removed like this
- Code: Select all
#define MEGA_SOFT_SPI
and run the SdFatWrite.pde sketch from the SdfFat/examples folder on the mega you should get:
Type any character to start
Writing to: WRITE00.TXT
Done
The recompile of SdFat should be automatic.
Rewiring the RTC is not so easy if you want to use hardware I2C. You need to add wires from the I2C header on the Data Logger shield to mega pins 20 and 21. The mega pins are marked with SDA and SCL. Connect the shield SDA pad to the mega SDA pin and shield SCL pad to the mega SCL pin. Do not use the mega analog pins 4,5 in your sketches since they are also connected to the RTC chip.
I have a soft I2C library that will allow the RTC to be used without the wires. I have only released a demo version. Here is the url
viewtopic.php?f=25&t=13722&p=66953&hilit=softi2c#p66953If you install the SoftI2CMaster library and edit the softDS1307.pde sketch like this:
- Code: Select all
// pins for DS1307 with software i2c
#define SCL_PIN 59
#define SDA_PIN 58
You should get this when you run the sketch on the mega:
The current time is 07/14/2010 Wed 09:48:32
Control: 03
Options are:
(0) Display date and time
(1) Set time
(2) Set date
(3) Set Control
(4) Dump all
(5) Set NV RAM
Enter option:
You could use code from this sketch to read the RTC chip on the mega with no hardware mods.