Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
firmware
boards
breezy
breezystm32
examples
mb10x0
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
}
pwmInit
void pwmInit(bool useCPPM, bool usePwmFilter, bool fastPWM, uint32_t motorPwmRate, uint16_t idlePulseUsec)
Definition:
drv_pwm.c:353
printf
#define printf
Definition:
printf.h:119
sonarRead
float sonarRead(uint8_t channel)
Definition:
drv_pwm.c:427
loop
void loop()
Definition:
mb10x0_read.c:10
distance
static float distance
Definition:
drv_sen13680.c:34
sonarPresent
bool sonarPresent()
Definition:
drv_pwm.c:432
setup
void setup()
Definition:
mb10x0_read.c:4
breezystm32.h
param_parser.i
int i
Definition:
param_parser.py:19
delay
void delay(uint32_t ms)
Definition:
system.c:98
rosflight_firmware
Author(s): Daniel Koch
, James Jackson
autogenerated on Wed Jul 3 2019 19:59:25