modify the api in sensor framework

This commit is contained in:
Wang_Weigen
2021-09-14 16:49:54 +08:00
parent cd9a3ee143
commit d77c1828b2
8 changed files with 53 additions and 54 deletions

View File

@@ -29,7 +29,7 @@ void Pm10Ps5308(void)
{
struct SensorQuantity *pm1_0 = SensorQuantityFind(SENSOR_QUANTITY_PS5308_PM1_0, SENSOR_QUANTITY_PM);
SensorQuantityOpen(pm1_0);
UserTaskDelay(2000);
PrivTaskDelay(2000);
printf("PM1.0 : %d ug/m³\n", SensorQuantityRead(pm1_0));
SensorQuantityClose(pm1_0);
}

View File

@@ -29,7 +29,7 @@ void VoiceD124(void)
{
struct SensorQuantity *voice = SensorQuantityFind(SENSOR_QUANTITY_D124_VOICE, SENSOR_QUANTITY_VOICE);
SensorQuantityOpen(voice);
UserTaskDelay(2000);
PrivTaskDelay(2000);
uint16 result = SensorQuantityRead(voice);
printf("voice : %d.%d dB\n", result/(10*voice->value.decimal_places), result%(10*voice->value.decimal_places));
SensorQuantityClose(voice);