Pages: [1]   Go Down
Author Topic: Problem of combining code  (Read 1070 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have:
1. an arduino duemilanove board with atmega328,
2. ADXL345Triple Axis Accelerometer http://www.sparkfun.com/products/9156
3. Breakout Board for microSD Transflash

I found two source codes on the internet. One for adxl345 and the other for the microSD breakout. I have tried to upload each of the code to atmega328 and they are workable and functional, ie adxl345 could get acceleration data of 3 axises after uploading the specific code and sd breakout board could work after uploading another specific code.

Because of the purpose of my study project, I want to combine two codes together to store the acceleration data recorded by adel345 into the sd card. However it was unsuccessful.

The attached files are as follow:
1. code for getting data from adxl345
2. code for reading data from sd card and writing data to sd card
3. combined code (but not successful)

Would anybody help me to have a look on the combined code?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

sorry, here are the attached files.

* code for getting data from adxl345.txt (2.33 KB - downloaded 11 times.)
* code for reading data from sd card and writing data to sd card.txt (8.14 KB - downloaded 13 times.)
* test 2.txt (3.93 KB - downloaded 13 times.)
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 601
Posts: 48556
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A description of the problem would be goo, too. "It didn't work" doesn't give us anything to work with. Surely some part of the code worked.
Logged

Sydney, Australia
Offline Offline
Full Member
***
Karma: 3
Posts: 230
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

He didn't say "it didn't work". He said "it was unsuccessful", and also "not successful". How much more information do you need Paul?! smiley-wink
Logged

Is life really that serious...??!

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 601
Posts: 48556
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
He didn't say "it didn't work". He said "it was unsuccessful", and also "not successful".
Is there some significant difference between "it was unsuccessful" and "it didn't work"?

Quote
How much more information do you need Paul?
Oh, perhaps, an explanation of how the program actually behaved vs. what OP wanted the program to do.

Where's your helpful information?
Logged

Sydney, Australia
Offline Offline
Full Member
***
Karma: 3
Posts: 230
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Mate, chill - didn't you see the smiley... smiley-wink

Jeez...
Logged

Is life really that serious...??!

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 601
Posts: 48556
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, yes, I did see the smiley. Can't see the face on the smiley. These new ones are stupid. Bring back the old smileys. I could see the faces on them.
Logged

Sydney, Australia
Offline Offline
Full Member
***
Karma: 3
Posts: 230
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

sorry, here are the attached files.

In your test code you setup the Serial port in 2 places in setup() with 2 different speeds...


   Serial.begin(9600);  // start serial for output
...

   // configure the serial port to command the card and read data
   Serial.begin(19200);

Is the serial port simply being used for debugging output?
Logged

Is life really that serious...??!

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry for late reply!

"Is the serial port simply being used for debugging output?"

Yes, it is simply for debugging output.
Logged

Pages: [1]   Go Up
Jump to: