Go Down

Topic: Problem on passing value from adxl to arduino mega (Read 668 times) previous topic - next topic

tlslaj0417

Mar 03, 2012, 10:28 am Last Edit: Mar 03, 2012, 10:32 am by tlslaj0417 Reason: 1
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? =(
this is my simple code:
Code: [Select]

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

Bajdi

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

tlslaj0417


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!

Bajdi

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

MarkT

The evaluation board is 3V3 only - so how are you level converting?
[ I won't respond to messages, use the forum please ]

tlslaj0417


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??

tlslaj0417


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^^

Go Up