mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-14 03:50:02 +03:00
adding sonar support from sbaron, disabled by default.
docs: http://www.rcgroups.com/forums/showpost.php?p=21903320&postcount=3827 git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@166 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
parent
09de7d7d03
commit
4366c7f0d4
9 changed files with 2710 additions and 2540 deletions
|
@ -454,3 +454,19 @@ void Mag_getADC(void)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SONAR
|
||||
|
||||
void Sonar_init(void)
|
||||
{
|
||||
hcsr04_init(sonar_rc78);
|
||||
sensorsSet(SENSOR_SONAR);
|
||||
sonarAlt = 0;
|
||||
}
|
||||
|
||||
void Sonar_update(void)
|
||||
{
|
||||
hcsr04_get_distance(&sonarAlt);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue