Mega2560 SPI with accelerometer
i trying use adxl345 accelerometer. sparkfun has great user guide, specific arduino uno.
it here ----> https://www.sparkfun.com/tutorials/240
the problem uno uses pins 10-13 cs, sda, sdo , scl. however, mega2560, using, uses pins 50-53.
apparently, spi.h library takes care of of pins according type of arduino have, except cs (chip/slave select). have defined cs 53 in sketch , changed in sparkfun's beginner sketch. theoretically should sufficient given spi.h takes care of other pins according arduino type. getting output of "-1" such device not connected.
please help, in advance.
it here ----> https://www.sparkfun.com/tutorials/240
the problem uno uses pins 10-13 cs, sda, sdo , scl. however, mega2560, using, uses pins 50-53.
apparently, spi.h library takes care of of pins according type of arduino have, except cs (chip/slave select). have defined cs 53 in sketch , changed in sparkfun's beginner sketch. theoretically should sufficient given spi.h takes care of other pins according arduino type. getting output of "-1" such device not connected.
please help, in advance.
..not sure, have read somewhere pin 10 must defined output
Arduino Forum > Using Arduino > Installation & Troubleshooting > Mega2560 SPI with accelerometer
arduino
Comments
Post a Comment