You are viewing an older revision! See the latest version

LIS302 Accelerometer

An LIS302 is a 3-axis accelerometer, accessible via a digital SPI interface with a selectable range of 2g or 8g.

LIS302 Breakout

Hello World!

main.cpp

#include "mbed.h"
#include "LIS302.h"

LIS302 acc(p5, p6, p7, p8); // mosi, miso, sclk, ncs

int main() {
    while(1) {
        printf("%.3f %.3f %.3f\n", acc.x(), acc.y(), acc.z());
        wait(0.1);
    }
}
LIS302 Signal Namembed pin
VccVout
GndGnd
SCLp7
MOSIp5
MISOp6
CSp8

Hello World Wiring

Library

Reference


All wikipages