Jump to content
43oh

blur3d

Members
  • Content Count

    3
  • Joined

  • Last visited

  1. Thanks for your reply. I'll have another play with it soon. But I think you are right. I was actually trying to get it working in Energia first, to help me write it using the TivaWare libraries. I can get the x, y and z to change with different movements, but with this code, I seem to have a similar issue. However, it seems to be around 65535 with no movement, and peak at 0 with lots of movement. So it's obviously a similar issue. And I actually think that y and z were always reading the same value. Anyway, I'll have a play and post an update. #include <stdbool.h> #incl
  2. I've changed the code to use uint16_t and seem to be getting better values. I'll keep testing things and post an update. //Add the SPI library so we can communicate with the ADXL345 sensor #include <SPI.h> //Assign the Chip Select signal to pin 2. int CS = 2; //This is a list of some of the registers available on the ADXL345. //To learn more about these and the rest of the registers on the ADXL345, read the datasheet! char POWER_CTL = 0x2D; //Power Control Register char DATA_FORMAT = 0x31; char DATAX0 = 0x32; //X-Axis Data 0 char DATAX1 = 0x33; //X-Axis Data 1 char DATAY0 = 0x34; //Y
  3. I'm trying to get my Tiva C (lm4f120) to read a adxl345 (accelerometer) and output the x, y and z values. I'm using the SSI2 peripheral, and everything seems to be wired correctly. By moving the adxl345 around, I can get the values to change, however they seem to overflow or something weird. They seem to tend toward 65535 when it should be reading 0. 65332 279 65519 65313 274 65528 65289 273 0 65271 275 1 65259 274 38 65318 238 69 65304 220 135 65303 207 134 65312 125 202 65308 67 242 65311 87 214 65316 69 222 65312 66 221 65310 68 219 65305 63 224 65513 65434 65430 58 68 65509
×
×
  • Create New...