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.
main.cpp@0:45ed48d2fec2, 2018-02-23 (annotated)
- Committer:
- csinders
- Date:
- Fri Feb 23 17:51:02 2018 +0000
- Revision:
- 0:45ed48d2fec2
- Child:
- 1:84b9a3e560fe
Initial Commit for Lab7
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
csinders | 0:45ed48d2fec2 | 1 | #include "mbed.h" |
csinders | 0:45ed48d2fec2 | 2 | #include "MPL3115.h" |
csinders | 0:45ed48d2fec2 | 3 | |
csinders | 0:45ed48d2fec2 | 4 | Serial pc(USBTX, USBRX); |
csinders | 0:45ed48d2fec2 | 5 | MPL3115 mpl(PB_7,PB_6); |
csinders | 0:45ed48d2fec2 | 6 | |
csinders | 0:45ed48d2fec2 | 7 | |
csinders | 0:45ed48d2fec2 | 8 | int main() { |
csinders | 0:45ed48d2fec2 | 9 | pc.printf("Starting program\r\n"); |
csinders | 0:45ed48d2fec2 | 10 | // Set mpl to active |
csinders | 0:45ed48d2fec2 | 11 | mpl.MPL3115::MPL3115_config(); |
csinders | 0:45ed48d2fec2 | 12 | while (1) { |
csinders | 0:45ed48d2fec2 | 13 | float test; |
csinders | 0:45ed48d2fec2 | 14 | mpl.acquire_MPL3115_data_Altitude_in_m(&test); |
csinders | 0:45ed48d2fec2 | 15 | pc.printf("test = %f\r\n", test); |
csinders | 0:45ed48d2fec2 | 16 | wait_ms(100); |
csinders | 0:45ed48d2fec2 | 17 | } |
csinders | 0:45ed48d2fec2 | 18 | } |