This simple example demonstares pothole detection using accelerometer and free-fall interrupt. Date and time is also displayed using real-time clock.
The project is forked from mbed os examples and modified.The application uses X-NUCLEO-IKS01A2's built-in LSM6DSL accelerometer sensor on top of the NUCLEO-F401RE board.
The example uses The official mbed C/C++ SDK and the library for X-NUCLEO-IKS01A2 (MEMS Inertial & Environmental Sensors) Expansion Board.
The easiest way is to use online IDE provided by Mbed : https://os.mbed.com/. After creating account for the online IDE on the website follow following steps:
- Create a new file main.cpp and copy the code from here to the new created main.cpp
- Add above dependecies
- Use Compile menu to build and download the binary file (automatically started)
- Connect your device
- Drag and drop the downloaded binary file to the device
- Use terminal tools such as CoolTerm to the connect serial port
The real-time clock is using unix time, you can convert time to the unix time using this website and set the time to desired time by changing following value set_time(1524497278);
on the main.cpp file
https://os.mbed.com/teams/ST/code/FreeFall_IKS01A2/file/3aa150c1a624/X_NUCLEO_IKS01A2.lib/