1
0
Fork 0
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:
timecop 2012-06-15 13:53:49 +00:00
parent 09de7d7d03
commit 4366c7f0d4
9 changed files with 2710 additions and 2540 deletions

View file

@ -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