Data Logging sketch for Mega

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Data Logging sketch for Mega

Postby fat16lib » Fri Mar 30, 2012 11:50 am

I have posted a sketch, MegaLogger.pde, that will run with no jumper wires on a Mega Arduino with the Data logging shield.

It will time stamp files and logs the data, time and analog data.

It uses software I2C and SPI on the Mega. It also runs on a UNO and uses hardware I2C and SPI.

I have included the libraries I used with the sketch.

The file is AdafruitMega20120329.zip located here http://code.google.com/p/beta-lib/downloads/list.
fat16lib
 
Posts: 586
Joined: Wed Dec 24, 2008 12:54 pm

Re: Data Logging sketch for Mega

Postby brantel » Fri Mar 30, 2012 4:21 pm

Yep it works great and can be very fast if you want!
brantel
 
Posts: 10
Joined: Thu Mar 01, 2012 8:13 am

Re: Data Logging sketch for Mega

Postby Donziboy2 » Fri Mar 30, 2012 8:49 pm

NICE !!!!!!!
Donziboy2
 
Posts: 32
Joined: Sun Feb 26, 2012 12:45 pm

Re: Data Logging sketch for Mega

Postby rob drizzle » Mon Apr 16, 2012 8:28 pm

Not only does it work perfectly, it's easy to use and understand! Thank you for your hard work :wink:
rob drizzle
 
Posts: 101
Joined: Wed May 04, 2011 5:14 pm

Re: Data Logging sketch for Mega

Postby Trueman » Tue Nov 06, 2012 9:03 pm

This does run well, I am using it to collect environmental data.
One question – the sync() function is not called anywhere in the code.
I have read that this must be called every time data is written to the card.
I don’t completely understand CD card programming but other examples I have seen do use the sync() function.
Possible it is called by the logger object, does nayone have any comments.

Thank you
Trueman
 
Posts: 1
Joined: Tue Nov 06, 2012 8:58 pm

Re: Data Logging sketch for Mega

Postby adafruit_support_bill » Wed Nov 07, 2012 6:17 am

The sync() function flushes any partially filled buffers to the card. Otherwise, the data is only written when the buffer fills up. Calling sync() on every write prevents loss of unwritten data, but it takes time and will limit your max logging speed.
User avatar
adafruit_support_bill
 
Posts: 16027
Joined: Sat Feb 07, 2009 9:11 am

Re: Data Logging sketch for Mega

Postby lemuroid » Sun Nov 25, 2012 2:51 pm

i am trying to your sketch to run on the DUE.

I keep getting:

In file included from C:\Documents and Settings\pcruz.CONFRMXP\My Documents\arduino-1.5.1r2\libraries\SdFat/SdFile.h:24,
from C:\Documents and Settings\pcruz.CONFRMXP\My Documents\arduino-1.5.1r2\libraries\SdFat/SdFat.h:26,
from AdafruitLogger.ino:3:
C:\Documents and Settings\pcruz.CONFRMXP\My Documents\arduino-1.5.1r2\libraries\SdFat/SdBaseFile.h:26: fatal error: avr/pgmspace.h: No such file or directory
compilation terminated.

what am i doing wrong?
lemuroid
 
Posts: 8
Joined: Wed Feb 02, 2011 4:35 pm

Re: Data Logging sketch for Mega

Postby gagnon_eric » Tue Feb 19, 2013 8:58 pm

Thank you Thank you Thank you.
For a long time I was trying to make my mega1280 to use my ethernet and sd card ad the same time using SDFAT just like with my UNO and with your beta library, everything work fine now, no problem at all... :D
gagnon_eric
 
Posts: 1
Joined: Tue Feb 19, 2013 8:55 pm


Return to Arduino Shields from Adafruit

Who is online

Users browsing this forum: No registered users and 4 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [103]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[109]
 
Wireless[14]
Cables[61]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]