Proyecto Nivel, Edgar Ochoa, Erik Garcia

Dependencies:   MMA8451Q mbed

versionerik.h

Committer:
verden32
Date:
2016-02-14
Revision:
35:60b29a00cf12
Parent:
34:822eacf4e7cb
Child:
36:2bc74f4ce17b
Child:
37:7bc8819f91f4

File content as of revision 35:60b29a00cf12:

#ifndef versionerik
#define versionerik
#include "mbed.h"

void erik_nivel(){
    
       /* r = 1.0 - abs(data[0]/16500.0);
        g = 1.0 - abs(data[1]/16500.0);
        b = 1.0 - abs(data[2]/16500.0);
        
    
        pc.printf("%d,%d,%d,\n",data[0],data[1],data[2]);
        
        wait(0.4);
        */
        
        
    
    if(350<data[1] && data[1]>150 && data[0]<-200 && data[0]>-320 && data[2]>16100 && data[2]<=16300){
        pc.printf("Nivel estable\n");
        wait (0.4);
        b=0;
        g=1;
        r=1;
        }else{
            b=1;
            g=1;
            r=0;
            }
            
        wait(0.1);
        
    }
    
#endif