Edgar Ochoa
/
ProyectoNivel
Proyecto Nivel, Edgar Ochoa, Erik Garcia
main.cpp@36:2bc74f4ce17b, 2016-02-15 (annotated)
- Committer:
- through
- Date:
- Mon Feb 15 03:31:21 2016 +0000
- Revision:
- 36:2bc74f4ce17b
- Parent:
- 33:387a18af3fb4
- Child:
- 39:41543351d339
modicaci?n luces, ya quedaron
Who changed what in which revision?
User | Revision | Line number | New 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); |
through | 36:2bc74f4ce17b | 31 | pc.printf("%d, %d, %d\n",data[0],data[1],data[2]); |
through | 36:2bc74f4ce17b | 32 | erik_nivel(); |
verden32 | 26:e10b8fb4e2ae | 33 | Mensajes(); |
through | 36:2bc74f4ce17b | 34 | |
verden32 | 0:cf09f0ecb330 | 35 | |
verden32 | 26:e10b8fb4e2ae | 36 | |
verden32 | 0:cf09f0ecb330 | 37 | |
through | 36:2bc74f4ce17b | 38 | wait(0.1); |
verden32 | 0:cf09f0ecb330 | 39 | |
verden32 | 0:cf09f0ecb330 | 40 | } |
verden32 | 0:cf09f0ecb330 | 41 | |
verden32 | 0:cf09f0ecb330 | 42 | } |
verden32 | 0:cf09f0ecb330 | 43 | |
vikglz | 1:f15981c66b73 | 44 | |
vikglz | 2:435a2b33e092 | 45 | //Hola Mundo!!! jajajaja |
vikglz | 9:4c0271cd6e49 | 46 | //otro cambio |