Pages: [1]   Go Down
Author Topic: Problem on passing value from adxl to arduino mega  (Read 622 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am a new beginner. is here the right place to post my problem here?I need help here. I have an ADXL345 evaluation board. and 1 ARDUINO MEGA 2560. I am thinking of passing 3 axis data to Arduino but it failed. Anyone can guide me here?I connect pin to pin. only connect it through tx-to-rx.
and write a simple program to test whether i receive the data or not. But i didnt receive the data. Anyone can help me? smiley-cry
this is my simple code:
Code:
int data = 0;   // for incoming serial data

void setup() {
        Serial.begin(9600);     // opens serial port, sets data rate to 9600 bps
}

void loop() {

        // send data only when you receive data:
        if (Serial.available() > 0) {
                // read the incoming byte:
                data = Serial.read();
                Serial.println(data, DEC);
        }
}
i refer to the reference in http://arduino.cc/en/Serial
« Last Edit: March 03, 2012, 04:32:25 am by tlslaj0417 » Logged

Belgium
Offline Offline
Sr. Member
****
Karma: 1
Posts: 281
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What kind of development board do you have? The ADXL345 uses the I2C or SPI bus.
Logged


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

What kind of development board do you have? The ADXL345 uses the I2C or SPI bus.
i get the product from here:
http://www.sparkfun.com/products/9814
I just using the Tx pin to transmit data from adxl to arduino....isnt it the correct way?

btw thanks for your reply appreciate much!
Logged

Belgium
Offline Offline
Sr. Member
****
Karma: 1
Posts: 281
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That page states that the default baud rate is 57600bps.
Logged


0
Offline Offline
Shannon Member
****
Karma: 206
Posts: 12179
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The evaluation board is 3V3 only - so how are you level converting?
Logged

[ I won't respond to messages, use the forum please ]

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

That page states that the default baud rate is 57600bps.

i test in 57600bps but still all in vain...is there any error in my code??or connection error between the pins??
Logged

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

The evaluation board is 3V3 only - so how are you level converting?
ya i did read the user guide of the evaluation board...so i am using 3v3 to power up the board.....

thanks for your reply^^
Logged

Pages: [1]   Go Up
Jump to: