本文整理匯總了Python中pycom.heartbeat方法的典型用法代碼示例。如果您正苦於以下問題:Python pycom.heartbeat方法的具體用法?Python pycom.heartbeat怎麽用?Python pycom.heartbeat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pycom
的用法示例。
在下文中一共展示了pycom.heartbeat方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: do_acess_point
# 需要導入模塊: import pycom [as 別名]
# 或者: from pycom import heartbeat [as 別名]
def do_acess_point():
global ap_if
if uname().machine == 'ESP32 module with ESP32': # Wemos ESP-WROOM-32
import network
ap_if = network.WLAN(network.AP_IF)
ap_if.active(True)
ap_if.config(essid=access_point_name, authmode=network.AUTH_OPEN)
elif uname().machine == 'WiPy with ESP32': # Wipy 2.0
import pycom
from network import WLAN
pycom.heartbeat(False)
ap_if = WLAN(mode=WLAN.AP, ssid=access_point_name)
ap_if.ifconfig(('192.168.4.1', '255.255.255.0', '192.168.4.1', '192.168.4.1'))
示例2: configure_rgb_led
# 需要導入模塊: import pycom [as 別名]
# 或者: from pycom import heartbeat [as 別名]
def configure_rgb_led(self):
"""https://docs.pycom.io/tutorials/all/rgbled.html"""
if self.platform_info.vendor == self.platform_info.MICROPYTHON.Pycom:
import pycom
# Enable or disable heartbeat.
rgb_led_heartbeat = self.settings.get('main.rgb_led.heartbeat', True)
terkin_blink_pattern = self.settings.get('main.rgb_led.terkin', False)
if terkin_blink_pattern:
rgb_led_heartbeat = False
pycom.heartbeat(rgb_led_heartbeat)
pycom.heartbeat_on_boot(rgb_led_heartbeat)