Rule Examples/en: различия между версиями

Новая страница: «=== CO2 === When the CO2 concentration is less than 650, we flash green once every 10 seconds.»
(Новая страница: «runShellCommand("echo " + period + " > /sys/class/pwm/pwmchip0/pwm2/period"); runShellCommand("echo " + duty_cycle + " > /sys/class/pwm/pwmchip0/pwm2/duty_cycle"); };»)
Метки: правка с мобильного устройства правка из мобильной версии
(Новая страница: «=== CO2 === When the CO2 concentration is less than 650, we flash green once every 10 seconds.»)
Метки: правка с мобильного устройства правка из мобильной версии
Строка 545: Строка 545:
=== Power status rule ===
=== Power status rule ===


<div lang="ru" dir="ltr" class="mw-content-ltr">
[https://github.com/contactless/wb-rules-system/blob/master/rules/power_status.js Rule] creates a virtual device that reports the current power status. Two ADC channels are used as input data: battery voltage measurement and input voltage measurement.
[https://github.com/contactless/wb-rules-system/blob/master/rules/power_status.js Правило] создаёт виртуальное устройство, которое сообщает текущий статус питания. В качестве входных данных используется два канала АЦП: измерение напряжения на аккумуляторе и измерение входного напряжения.
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
The following logic is implemented:
Реализована следующая логика:
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
1. If the input voltage is less than the battery voltage, then the board is powered by the battery. In this case, 0V is also displayed as the input voltage.
1. Если входное напряжение меньше напряжение на аккумуляторе, то значит плата питается от аккумулятора. В этом случае, также отображается 0V в качестве входного напряжения.
</div>


<div lang="ru" dir="ltr" class="mw-content-ltr">
<div lang="ru" dir="ltr" class="mw-content-ltr">
translator, wb_editors
4344

правки