Proyecto Nivel, Edgar Ochoa, Erik Garcia

Dependencies:   MMA8451Q mbed

Committer:
verden32
Date:
Fri Feb 12 14:38:24 2016 +0000
Revision:
25:2d2f8736f147
Parent:
22:de1ab79df237
corregido final

Who changed what in which revision?

UserRevisionLine numberNew contents of line
vikglz 9:4c0271cd6e49 1 #include "adcBasic.h"
verden32 25:2d2f8736f147 2 float x,y,z;
verden32 0:cf09f0ecb330 3 PwmOut r(LED_RED);
verden32 0:cf09f0ecb330 4 PwmOut g(LED_GREEN);
verden32 0:cf09f0ecb330 5 PwmOut b(LED_BLUE);
vikglz 9:4c0271cd6e49 6 Serial pc(USBTX,USBRX);
verden32 25:2d2f8736f147 7 int16_t data[3];
verden32 25:2d2f8736f147 8 #include "Ochoa.h"
verden32 25:2d2f8736f147 9 #include "versionerik.h"
verden32 25:2d2f8736f147 10 #include "mbed.h"
verden32 25:2d2f8736f147 11 #include "MMA8451Q.h"
verden32 25:2d2f8736f147 12 MMA8451Q acc(PTE25, PTE24);
verden32 0:cf09f0ecb330 13
vikglz 9:4c0271cd6e49 14
vikglz 9:4c0271cd6e49 15
verden32 25:2d2f8736f147 16
verden32 25:2d2f8736f147 17
verden32 0:cf09f0ecb330 18 int main() {
verden32 0:cf09f0ecb330 19
verden32 0:cf09f0ecb330 20 pc.baud(9600); //velocidad serial//
verden32 0:cf09f0ecb330 21 pc.format(8,SerialBase::None ,1) ;
verden32 0:cf09f0ecb330 22 pc.putc(65);
vikglz 9:4c0271cd6e49 23 mensaje();
verden32 0:cf09f0ecb330 24 while(1) {
verden32 0:cf09f0ecb330 25
verden32 0:cf09f0ecb330 26 acc.getAccAllAxis(data);
through 10:76ab6531ba6f 27
through 22:de1ab79df237 28 z = 1.0 - abs(data[0]/16500.0);
through 22:de1ab79df237 29 y = 1.0 - abs(data[1]/16500.0);
through 22:de1ab79df237 30 x = 1.0 - abs(data[2]/16500.0);
verden32 25:2d2f8736f147 31 erik_nivel();
verden32 25:2d2f8736f147 32 Mensajes();
verden32 0:cf09f0ecb330 33 pc.printf("%d,%d,%d,\n",data[0],data[1],data[2]);
verden32 0:cf09f0ecb330 34
verden32 0:cf09f0ecb330 35 wait(0.4);
verden32 0:cf09f0ecb330 36
verden32 0:cf09f0ecb330 37 }
verden32 0:cf09f0ecb330 38
verden32 0:cf09f0ecb330 39 }
verden32 0:cf09f0ecb330 40
vikglz 1:f15981c66b73 41
vikglz 2:435a2b33e092 42 //Hola Mundo!!! jajajaja
vikglz 9:4c0271cd6e49 43 //otro cambio