Proyecto Nivel, Edgar Ochoa, Erik Garcia

Dependencies:   MMA8451Q mbed

Committer:
through
Date:
Fri Feb 12 14:58:02 2016 +0000
Revision:
33:387a18af3fb4
Parent:
27:85d44b207258
Child:
36:2bc74f4ce17b
Child:
37:7bc8819f91f4
version erik una mas

Who changed what in which revision?

UserRevisionLine numberNew contents of line
vikglz 9:4c0271cd6e49 1 #include "adcBasic.h"
verden32 27:85d44b207258 2
verden32 27:85d44b207258 3 int16_t data[3];
verden32 0:cf09f0ecb330 4 PwmOut r(LED_RED);
verden32 0:cf09f0ecb330 5 PwmOut g(LED_GREEN);
verden32 0:cf09f0ecb330 6 PwmOut b(LED_BLUE);
vikglz 9:4c0271cd6e49 7 Serial pc(USBTX,USBRX);
through 22:de1ab79df237 8 float x,y,z;
verden32 27:85d44b207258 9 #include "Ochoa.h"
verden32 27:85d44b207258 10 #include "versionerik.h"
verden32 27:85d44b207258 11 #include "mbed.h"
verden32 27:85d44b207258 12 #include "MMA8451Q.h"
verden32 27:85d44b207258 13 MMA8451Q acc(PTE25, PTE24);
verden32 0:cf09f0ecb330 14
vikglz 9:4c0271cd6e49 15
vikglz 9:4c0271cd6e49 16
verden32 27:85d44b207258 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);
verden32 26:e10b8fb4e2ae 23
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 26:e10b8fb4e2ae 31 Mensajes();
verden32 26:e10b8fb4e2ae 32 erik_nivel();
verden32 0:cf09f0ecb330 33
verden32 26:e10b8fb4e2ae 34
verden32 0:cf09f0ecb330 35
through 33:387a18af3fb4 36 wait(0.2);
verden32 0:cf09f0ecb330 37
verden32 0:cf09f0ecb330 38 }
verden32 0:cf09f0ecb330 39
verden32 0:cf09f0ecb330 40 }
verden32 0:cf09f0ecb330 41
vikglz 1:f15981c66b73 42
vikglz 2:435a2b33e092 43 //Hola Mundo!!! jajajaja
vikglz 9:4c0271cd6e49 44 //otro cambio