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: LRAT-example-lorawan-REFACTOR-and-CLEAN-Branch
accelerometer.h@1:d33940a636b0, 2018-09-13 (annotated)
- Committer:
- Huot87
- Date:
- Thu Sep 13 18:13:45 2018 +0000
- Revision:
- 1:d33940a636b0
- Parent:
- 0:252a026cb80b
Work In Progress -- Code Cleanup and Refactor
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| Huot87 | 0:252a026cb80b | 1 | #ifndef ACCELEROMETER_H_ | 
| Huot87 | 0:252a026cb80b | 2 | #define ACCELEROMETER_H_ | 
| Huot87 | 0:252a026cb80b | 3 | |
| Huot87 | 1:d33940a636b0 | 4 | #include "mbed.h" | 
| Huot87 | 1:d33940a636b0 | 5 | |
| Huot87 | 0:252a026cb80b | 6 | class Accelerometer | 
| Huot87 | 0:252a026cb80b | 7 | { | 
| Huot87 | 1:d33940a636b0 | 8 | public: | 
| Huot87 | 1:d33940a636b0 | 9 | |
| Huot87 | 1:d33940a636b0 | 10 | /** | 
| Huot87 | 1:d33940a636b0 | 11 | */ | 
| Huot87 | 1:d33940a636b0 | 12 | Accelerometer(); | 
| Huot87 | 1:d33940a636b0 | 13 | |
| Huot87 | 1:d33940a636b0 | 14 | /** | 
| Huot87 | 1:d33940a636b0 | 15 | */ | 
| Huot87 | 1:d33940a636b0 | 16 | virtual ~Accelerometer(); | 
| Huot87 | 1:d33940a636b0 | 17 | |
| Huot87 | 1:d33940a636b0 | 18 | /** | 
| Huot87 | 1:d33940a636b0 | 19 | */ | 
| Huot87 | 1:d33940a636b0 | 20 | void setters(I2C *_i2c, char *_buf); | 
| Huot87 | 1:d33940a636b0 | 21 | |
| Huot87 | 1:d33940a636b0 | 22 | /** | 
| Huot87 | 1:d33940a636b0 | 23 | */ | 
| Huot87 | 1:d33940a636b0 | 24 | void dumpCfg(); | 
| Huot87 | 1:d33940a636b0 | 25 | |
| Huot87 | 1:d33940a636b0 | 26 | /** | 
| Huot87 | 1:d33940a636b0 | 27 | */ | 
| Huot87 | 1:d33940a636b0 | 28 | void onIRQ(); | 
| Huot87 | 1:d33940a636b0 | 29 | |
| Huot87 | 1:d33940a636b0 | 30 | /** | 
| Huot87 | 1:d33940a636b0 | 31 | */ | 
| Huot87 | 1:d33940a636b0 | 32 | void init(); | 
| Huot87 | 1:d33940a636b0 | 33 | |
| Huot87 | 1:d33940a636b0 | 34 | /** | 
| Huot87 | 1:d33940a636b0 | 35 | */ | 
| Huot87 | 1:d33940a636b0 | 36 | //void read(); | 
| Huot87 | 1:d33940a636b0 | 37 | |
| Huot87 | 1:d33940a636b0 | 38 | /** | 
| Huot87 | 1:d33940a636b0 | 39 | */ | 
| Huot87 | 1:d33940a636b0 | 40 | char *buf; | 
| Huot87 | 1:d33940a636b0 | 41 | |
| Huot87 | 1:d33940a636b0 | 42 | private: | 
| Huot87 | 1:d33940a636b0 | 43 | /** | 
| Huot87 | 1:d33940a636b0 | 44 | */ | 
| Huot87 | 1:d33940a636b0 | 45 | I2C *i2c; | 
| Huot87 | 1:d33940a636b0 | 46 | |
| Huot87 | 1:d33940a636b0 | 47 | InterruptIn accPin; | 
| Huot87 | 0:252a026cb80b | 48 | }; | 
| Huot87 | 0:252a026cb80b | 49 | |
| Huot87 | 0:252a026cb80b | 50 | #endif |