mb10x0_read.c
Go to the documentation of this file.
1 #include <breezystm32.h>
2 
3 
4 void setup()
5 {
6  pwmInit(true, false, false, 490, 1000);
7 }
8 
9 
10 void loop()
11 {
12  if (sonarPresent())
13  {
14  printf("\nsonar read = ");
15  for (int i = 0; i < 7; i++)
16  {
17  float distance = sonarRead(i);
18  printf("%d.%dm\t", (int32_t)distance, (int32_t)(distance*1000)%1000);
19  }
20  }
21  else
22  {
23  printf("\nno sonar");
24  }
25  delay(50);
26 }
void pwmInit(bool useCPPM, bool usePwmFilter, bool fastPWM, uint32_t motorPwmRate, uint16_t idlePulseUsec)
Definition: drv_pwm.c:353
#define printf
Definition: printf.h:119
float sonarRead(uint8_t channel)
Definition: drv_pwm.c:427
void loop()
Definition: mb10x0_read.c:10
static float distance
Definition: drv_sen13680.c:34
bool sonarPresent()
Definition: drv_pwm.c:432
void setup()
Definition: mb10x0_read.c:4
void delay(uint32_t ms)
Definition: system.c:98


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Oct 24 2019 03:17:19