Naresh krish
Published

Interfacing with sensors on iTracker using Mbed

This tutorial would take you through the steps required to build mbed firmware for the itracker sensor modules using Mbed online compiler.

AdvancedProtip4 hours938
Interfacing with sensors on iTracker using Mbed

Things used in this project

Hardware components

RAKwireless iTracker board
×1
JLink usb module
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Mbed Online compiler
Arm Mbed MBED Arm Project Development Environment

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

iTracker schematics

File missing, please reupload.

Code

Sample app

C/C++
No preview (download only).

Sample app template

C/C++
#include "mbed.h"
#include "SEGGER_RTT.h"
#include "LIS3DH.h"
 
// main() runs in its own thread in the OS
int main() {
 I2C i2c(p19,p18);              // SDA, SCL
 LIS3DH acc(i2c, LIS3DH_V_CHIP_ADDR, LIS3DH_DR_NR_LP_50HZ, LIS3DH_FS_8G);
 
 
    SEGGER_RTT_printf(0, "dev id is %d \n", acc.read_id());   
    if (acc.read_id() == I_AM_LIS3DH){
       while(1) {
           float f[3];
           acc.read_data(f);
           wait(0.5);
       }
    }
}
 

Credits

Naresh krish

Naresh krish

22 projects • 117 followers
Maker, Hacker, Guitarist, Full time Android and iOS Dev.
Thanks to Mbed and RakWireless.

Comments