Olivia Itzel Solano
/
Contador_De_Pasos
Contador de pasos
solano.h
- Committer:
- OlySolano
- Date:
- 2016-02-12
- Revision:
- 9:ff57931068f4
- Parent:
- 2:0feb4132c246
- Child:
- 12:a73fdd04a291
File content as of revision 9:ff57931068f4:
#ifndef SOLANO #define SOLANO #include "mbed.h" #include "MMA8451Q.h" Serial serial1 (USBTX, USBRX); MMA8451Q acc(PTE25, PTE24); PwmOut rled(LED_RED); PwmOut gled(LED_GREEN); PwmOut bled(LED_BLUE); int16_t data [3]; int main() { serial1.baud(9600); serial1.format(8,SerialBase::None,1); serial1.putc(65); while(1) { acc.getAccAllAxis(data); //serial1.printf("%d\n",data[0]); //serial1.printf("%d\n",data[1]); serial1.printf("%d\n",data[2]); //rled = 1.0 - abs(data[0]/17000.0); //gled = 1.0 - abs(data[1]/17000.0); bled = 1.0 - abs(data[2]/17000.0); wait(0.4); } } #endif