lab 6
Dependencies: ADXL362 mbed MPL3115A2
Revision 11:5aba4ea23082, committed 2018-02-22
- Comitter:
- rmneubau
- Date:
- Thu Feb 22 21:20:47 2018 +0000
- Parent:
- 10:8dcc46dd53bf
- Child:
- 14:0c2659ce7a8a
- Commit message:
- LED/vibration works
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Feb 22 21:13:54 2018 +0000
+++ b/main.cpp Thu Feb 22 21:20:47 2018 +0000
@@ -2,7 +2,7 @@
#include "ADXL362.h"
#include "string.h"
-DigitalOut led1(LD3);
+DigitalOut led1(LED3);
//map of register values and names
int regids[34];
@@ -133,7 +133,7 @@
adxl362.reset();
wait_ms(600); // we need to wait at least 500ms after ADXL362 reset
adxl362.set_mode(ADXL362::MEASUREMENT);
- int8_t x,y,z, initx, inity, intiz;
+ int8_t x,y,z, initx, inity, initz;
int start, length;
start = 0;
length = 5;
@@ -153,7 +153,7 @@
z=adxl362.scanz_u8();
if(x > initx+2 || y > inity+2 || z > initz+2){
led1 = 1;
- wait_ms(200);
+ wait_ms(2000);
led1 = 0;
}
printf("x = %d y = %d z = %d\r\n",x,y,z);