Skip to main content

Subsection 12.4.4 The Rest of the Hunt

A datasheet is not read cover to cover; the skill is jumping to the part that answers your question, and that takes knowing roughly what is in the document. So before you close the PDF, make four more stops. Each one is a place this course has already leaned on, or is about to.
  • Go to §2.1, Table 3 (pp. 13–14), the sensor characteristics. Find the zero-g offset row and read off its typical value; this is the number behind the “a few tens of milli-g off” in Subsection 12.4.1.
  • Go to §7, Table 26 (p. 43), the register address map. Find the six output registers, OUT_X_L_A through OUT_Z_H_A, and note their addresses; these are the registers lsm303_AccelReadRaw() reads in one auto-increment transfer. Notice the map also lists the magnetometer’s registers and a temperature-sensor configuration register; we use neither.
  • Go to §8.4 (p. 46) and find WHO_AM_I_A, the register Tuesday’s test program read; the fixed value 0x33 is printed there as its default.
  • Go to §6.1.1, Tables 20–23 (p. 38), the four I2C transfer diagrams. Table 22 is the read you captured on Tuesday, and Table 20 is the write you will make on Thursday.