![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
(in progress)
Dependencies: LM75B EALib mbed
main_proj3.cpp@0:53a593dea14e, 2015-10-12 (annotated)
- Committer:
- kinetik
- Date:
- Mon Oct 12 23:03:47 2015 +0000
- Revision:
- 0:53a593dea14e
- Child:
- 1:f5ad0c1f9d0f
project3;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kinetik | 0:53a593dea14e | 1 | #include <LM75B.h> //Temperature header file |
kinetik | 0:53a593dea14e | 2 | #include <MMA7455.h> // Accelerometer header file |
kinetik | 0:53a593dea14e | 3 | |
kinetik | 0:53a593dea14e | 4 | Serial myUart (USBTX, USBRX); |
kinetik | 0:53a593dea14e | 5 | LM75B tempsensor(P0_27, P0_28); |
kinetik | 0:53a593dea14e | 6 | MMA7455 sensor(P0_27, P0_28); |
kinetik | 0:53a593dea14e | 7 | |
kinetik | 0:53a593dea14e | 8 | int main() |
kinetik | 0:53a593dea14e | 9 | { |
kinetik | 0:53a593dea14e | 10 | char in_bound; |
kinetik | 0:53a593dea14e | 11 | myUart.baud(19200); // setting the baud rate |
kinetik | 0:53a593dea14e | 12 | int value[3] = { 0,0,0}; |
kinetik | 0:53a593dea14e | 13 | |
kinetik | 0:53a593dea14e | 14 | while(1) { |
kinetik | 0:53a593dea14e | 15 | if(!sensor.setMode(MMA7455::ModeMeasurement) |
kinetik | 0:53a593dea14e | 16 | printf("Unable to set mode for MMA7455!\n"); |
kinetik | 0:53a593dea14e | 17 | if(!sensor.calibrate()) |
kinetik | 0:53a593dea14e | 18 | printf("Failed to calibrate MMA7455!\n"); |
kinetik | 0:53a593dea14e | 19 | |
kinetik | 0:53a593dea14e | 20 | if(!sensor.read) |
kinetik | 0:53a593dea14e | 21 | |
kinetik | 0:53a593dea14e | 22 | |
kinetik | 0:53a593dea14e | 23 | |
kinetik | 0:53a593dea14e | 24 | |
kinetik | 0:53a593dea14e | 25 | } |
kinetik | 0:53a593dea14e | 26 | |
kinetik | 0:53a593dea14e | 27 | |
kinetik | 0:53a593dea14e | 28 | |
kinetik | 0:53a593dea14e | 29 | |
kinetik | 0:53a593dea14e | 30 | |
kinetik | 0:53a593dea14e | 31 | |
kinetik | 0:53a593dea14e | 32 | |
kinetik | 0:53a593dea14e | 33 | |
kinetik | 0:53a593dea14e | 34 | |
kinetik | 0:53a593dea14e | 35 | |
kinetik | 0:53a593dea14e | 36 | |
kinetik | 0:53a593dea14e | 37 | } |