Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: 3_test_EEROMM-barometer 5_waitmode 5_flightmode 5-2_thrustermode ... more
Diff: LPS33HW.h
- Revision:
- 0:efb4130c9550
- Child:
- 1:9574dea45061
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LPS33HW.h Mon Jun 29 08:13:45 2020 +0000 @@ -0,0 +1,42 @@ +#ifndef MBED_LPS33HW_H +#define MBED_LPS33HW_H + +#include "mbed.h" + +//LPS33HW slave address +#define S_add 0xB8 + +//Check adress +#define WHO_AM_I 0x0F + +//CTRL_REG1 +#define CTRL_REG1 0x10 + +//Start Up +#define Normal 0x10 //normal(1Hz) +#define High_rate 0x50 //High rate(75Hz) + +//data register +#define press_msb 0x2A +#define press_lsb 0x29 +#define press_xlsb 0x28 + +class LPS33HW +{ +public: + LPS33HW(PinName sda,PinName scl); + ~LPS33HW(); + + char read(char regist); //基本read関数 + void write(char regist,char data); //基本write関数 + char who(); //WHO_AM_I + void start(char mode); //Start,mode0;normal,mode1;high rate + double data_read(); //pressure read + +private: + I2C i2c; + char addr; +}; + +#endif +