Skip to content

Utility to detect the accelerometer of a micro:bit board.

License

Notifications You must be signed in to change notification settings

KLOC-Karsten/mb_accel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mb_accel

Utility to detect the accelerometer of a micro:bit board.

Background

The BBC micro:bit board contains - depending on the hardware revision - one of three different motion sensors: either the Freescale MMA8653FC (rev 1.3), the ST LSM303AGR (rev 1.5), or the NXP FXOS8700 (rev 1.5). See also this page.

Currently, the Ada Drivers Library contains only the code for the MMA8653 motion sensor. Even worse, your application will crash if your micro:bit contains the LSM303 sensor and you use the MicroBit.Accelerometer package, because it automatically tries to configure an MMA8653! This library contains a simple routine to detect the motion sensor of your micro:bit.

Usage

Use the library together with the Ada Drivers Library micro:bit BSP- Example:

    if MB_Accel.Detect_Accelerometer(MicroBit.I2C.Controller) = MB_Accel.LSM303 then
      ...
    end if;

About

Utility to detect the accelerometer of a micro:bit board.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages