Lab4-01_measure_acceleration_lite

Dependencies:   mbed HEPTA_SENSOR_lite HEPTA_EPS_lite

Committer:
heptasat2021
Date:
Fri Aug 20 12:31:01 2021 +0000
Revision:
2:48467db233ff
Parent:
1:ddac5ec89167
Child:
3:b5809ec2a8cd
For Hepta-Sat Lite

Who changed what in which revision?

UserRevisionLine numberNew contents of line
heptasat2021 0:da0f6aca15b8 1 #include "mbed.h"
heptasat2021 2:48467db233ff 2 #include "HEPTA_EPS.h"
heptasat2021 2:48467db233ff 3 #include "HEPTA_SENSOR.h"
heptasat2021 2:48467db233ff 4 HEPTA_EPS eps(PA_0,PA_4);
heptasat2021 2:48467db233ff 5 HEPTA_SENSOR sensor(PA_7,PB_7,PB_6,0xD0);
heptasat2021 0:da0f6aca15b8 6 Serial pc(USBTX,USBRX,9600);
heptasat2021 0:da0f6aca15b8 7 int main()
heptasat2021 2:48467db233ff 8 {
heptasat2021 2:48467db233ff 9 float ax,ay,az;
heptasat2021 2:48467db233ff 10 pc.printf("Acceleration Sensor\r\n");
heptasat2021 2:48467db233ff 11 eps.turn_on_regulator(); //Turn on 3.3V converter
heptasat2021 2:48467db233ff 12 for(int i=0;i<50;i++){
heptasat2021 2:48467db233ff 13 sensor.sen_acc(&ax,&ay,&az);
heptasat2021 2:48467db233ff 14 pc.printf("%f,%f,%f\r\n",ax,ay,az);
heptasat2021 2:48467db233ff 15 wait_ms(1000);
heptasat2021 0:da0f6aca15b8 16 }
heptasat2021 0:da0f6aca15b8 17 }