Proyecto Nivel, Edgar Ochoa, Erik Garcia

Dependencies:   MMA8451Q mbed

versionerik.h

Committer:
verden32
Date:
2016-02-15
Revision:
37:7bc8819f91f4
Parent:
35:60b29a00cf12

File content as of revision 37:7bc8819f91f4:

#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]>140 && data[0]<-120 && data[0]>-340 && data[2]>16100 && data[2]<=16300){
        pc.printf("Nivel estable\n");
        
        b=0;
        g=1;
        r=1;
        wait (0.4);
        }else{
            b=1;
            g=1;
            r=0;
            }
            
        wait(0.1);
        
    }
    
#endif