![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
invoer/kompas.h@0:bec310bde899, 2011-09-27 (annotated)
- Committer:
- pd0wm
- Date:
- Tue Sep 27 19:46:30 2011 +0000
- Revision:
- 0:bec310bde899
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pd0wm | 0:bec310bde899 | 1 | #ifndef KOMPAS_H |
pd0wm | 0:bec310bde899 | 2 | #define KOMPAS_H |
pd0wm | 0:bec310bde899 | 3 | |
pd0wm | 0:bec310bde899 | 4 | #include "mbed.h" |
pd0wm | 0:bec310bde899 | 5 | #include <math.h> |
pd0wm | 0:bec310bde899 | 6 | |
pd0wm | 0:bec310bde899 | 7 | #define ADDR 0x32 |
pd0wm | 0:bec310bde899 | 8 | |
pd0wm | 0:bec310bde899 | 9 | class Kompas{ |
pd0wm | 0:bec310bde899 | 10 | |
pd0wm | 0:bec310bde899 | 11 | I2C compass; // sda, scl |
pd0wm | 0:bec310bde899 | 12 | int cal; |
pd0wm | 0:bec310bde899 | 13 | int koers,prev; |
pd0wm | 0:bec310bde899 | 14 | Ticker refresh; |
pd0wm | 0:bec310bde899 | 15 | int opslag[10]; |
pd0wm | 0:bec310bde899 | 16 | public: |
pd0wm | 0:bec310bde899 | 17 | Kompas(); |
pd0wm | 0:bec310bde899 | 18 | int get(void); |
pd0wm | 0:bec310bde899 | 19 | void simulate(int); |
pd0wm | 0:bec310bde899 | 20 | void update(void); |
pd0wm | 0:bec310bde899 | 21 | void startcal(void); |
pd0wm | 0:bec310bde899 | 22 | void stopcal(void); |
pd0wm | 0:bec310bde899 | 23 | }; |
pd0wm | 0:bec310bde899 | 24 | |
pd0wm | 0:bec310bde899 | 25 | |
pd0wm | 0:bec310bde899 | 26 | #endif |