Lab4-02_measure_angular_velocity_lite
Dependencies: mbed HEPTA_SENSOR_lite HEPTA_EPS_lite
main.cpp
00001 #include "mbed.h" 00002 #include "HEPTA_EPS.h" 00003 #include "HEPTA_SENSOR.h" 00004 HEPTA_EPS eps(PA_0,PA_4); 00005 HEPTA_SENSOR sensor(PA_7,PB_7,PB_6,0xD0); 00006 Serial pc(USBTX,USBRX,9600); 00007 int main() 00008 { 00009 float gx,gy,gz; 00010 pc.printf("Angular Velocity Sensor\r\n"); 00011 eps.turn_on_regulator(); //Turn on 3.3V converter 00012 sensor.setup(); 00013 for(int i=0;i<50;i++){ 00014 sensor.sen_gyro(&gx,&gy,&gz); 00015 pc.printf("%f,%f,%f\r\n",gx,gy,gz); 00016 wait_ms(1000); 00017 } 00018 }
Generated on Wed Aug 3 2022 18:29:32 by
1.7.2