mbed workshop intro + cansat examples

Accel1.cpp

Committer:
yamaguch
Date:
2012-05-10
Revision:
0:f309f06aeec7

File content as of revision 0:f309f06aeec7:

#include "mbed.h"

AnalogIn x(p15);
AnalogIn y(p16);
AnalogIn z(p17);
DigitalIn zeroGDetect(p25);
DigitalOut gSelect(p26);
DigitalOut sleep(p24);

int main() {
    gSelect = 1; // 6g mode
    sleep = 1;   // do not sleep
    
    while (true) {
        printf("x = %5.3f, y = %5.3f, z = %5.3f\n", x.read(), y.read(), z.read());
        wait(1.0);
    }
}