code
stringlengths
1
1.05M
repo_name
stringlengths
6
83
path
stringlengths
3
242
language
stringclasses
222 values
license
stringclasses
20 values
size
int64
1
1.05M
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def back_click_callback(e, win): import page_basic page_basic.load_page() def event_handler(e): code = e.get_code() obj = e.get_target() if code == lv.EVENT.VALUE_CHANGED: txt = obj.get_text() if obj.get_state() & lv.STATE...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_checkbox.py
Python
apache-2.0
1,747
import lvgl as lv import wifi_module import _thread import font_Alibaba_PuHuiTi RESOURCES_ROOT = "S:/data/pyamp/images/" wifiSSID = "" wifiPassword = "" def wifi_connect(): global wifiSSID global wifiPassword result = False result = wifi_module.wifi_connect(wifiSSID, wifiPassword) if (result ==...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_connect.py
Python
apache-2.0
1,637
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def environment_back_click_callback(e, win): import page_sensors2 page_sensors2.load_page() def environment_back_press_callback(e, back_image): back_image.set_zoom(280) def environment_back_release_callback(e, back_image): back_image.set_zoo...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_distance.py
Python
apache-2.0
1,393
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def back_click_callback(e, win): import page_basic page_basic.load_page() # 下拉列表动作回调函数 def event_handler(e): code = e.get_code() obj = e.get_target() if code == lv.EVENT.VALUE_CHANGED: option = " "*10 # should be large enough to s...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_dropdown.py
Python
apache-2.0
1,396
import lvgl as lv import font_Alibaba_PuHuiTi RESOURCES_ROOT = "S:/data/pyamp/images/" def event1_handler(evt): code = evt.get_code() ele = evt.get_target() if code == lv.EVENT.CLICKED: import page_haas page_haas.load_page() elif code == lv.EVENT.PRESSED: ele.set_style_bg_color...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_failed.py
Python
apache-2.0
2,176
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def environment_back_click_callback(e, win): import page_sensors2 page_sensors2.load_page() def environment_back_press_callback(e, back_image): back_image.set_zoom(280) def environment_back_release_callback(e, back_image): back_image.set_zoo...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_fm.py
Python
apache-2.0
1,345
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def environment_back_click_callback(e, win): import page_sensors1 page_sensors1.load_page() def environment_back_press_callback(e, back_image): back_image.set_zoom(280) def environment_back_release_callback(e, back_image): back_image.set_zoo...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_gas.py
Python
apache-2.0
1,351
import lvgl as lv import wifi_module import font_Alibaba_PuHuiTi RESOURCES_ROOT = "S:/data/pyamp/images/" images = [RESOURCES_ROOT + "basic_ui.png", RESOURCES_ROOT + "sensor_ui.png", RESOURCES_ROOT + "aiot_solution.png", RESOURCES_ROOT + "setting.png"] titles = ["基础UI", "传感器UI...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_haas.py
Python
apache-2.0
3,725
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def environment_back_click_callback(e, win): import page_sensors2 page_sensors2.load_page() def environment_back_press_callback(e, back_image): back_image.set_zoom(280) def environment_back_release_callback(e, back_image): back_image.set_zoo...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_hcho.py
Python
apache-2.0
1,362
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def environment_back_click_callback(e, win): import page_sensors1 page_sensors1.load_page() def environment_back_press_callback(e, back_image): back_image.set_zoom(280) def environment_back_release_callback(e, back_image): back_image.set_zoo...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_heartrate.py
Python
apache-2.0
1,399
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def environment_back_click_callback(e, win): import page_sensors2 page_sensors2.load_page() def environment_back_press_callback(e, back_image): back_image.set_zoom(280) def environment_back_release_callback(e, back_image): back_image.set_zoo...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_humidity.py
Python
apache-2.0
1,392
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def environment_back_click_callback(e, win): import page_sensors1 page_sensors1.load_page() def environment_back_press_callback(e, back_image): back_image.set_zoom(280) def environment_back_release_callback(e, back_image): back_image.set_zoo...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_humiture.py
Python
apache-2.0
1,391
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def back_click_callback(e, win): import page_basic page_basic.load_page() def load_page(): scr = lv.obj() scr.set_style_bg_color(lv.color_black(), 0) backImg=lv.img(scr) backImg.set_src(RESOURCES_ROOT + "back.png") backImg.set_st...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_image.py
Python
apache-2.0
804
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def back_click_callback(e, win): import page_basic page_basic.load_page() def ta_event_cb(e,kb): code = e.get_code() ta = e.get_target() if code == lv.EVENT.FOCUSED: kb.set_textarea(ta) kb.clear_flag(lv.obj.FLAG.HIDDEN) ...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_keyboard.py
Python
apache-2.0
1,425
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def back_click_callback(e, win): import page_basic page_basic.load_page() def load_page(): scr = lv.obj() scr.set_style_bg_color(lv.color_black(), 0) backImg=lv.img(scr) backImg.set_src(RESOURCES_ROOT + "back.png") backImg.set_st...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_label.py
Python
apache-2.0
1,401
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def back_click_callback(e, win): import page_basic page_basic.load_page() def load_page(): scr = lv.obj() scr.set_style_bg_color(lv.color_black(), 0) backImg=lv.img(scr) backImg.set_src(RESOURCES_ROOT + "back.png") backImg.set_st...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_led.py
Python
apache-2.0
1,008
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def back_click_callback(e, win): import page_basic page_basic.load_page() def load_page(): scr = lv.obj() scr.set_style_bg_color(lv.color_black(), 0) backImg=lv.img(scr) backImg.set_src(RESOURCES_ROOT + "back.png") backImg.set_st...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_line.py
Python
apache-2.0
1,106
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" list1 = None def back_click_callback(e, win): import page_basic page_basic.load_page() def event_handler(e): global list1 code = e.get_code() obj = e.get_target() if code == lv.EVENT.CLICKED: print("Clicked: list1." + list...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_list.py
Python
apache-2.0
2,303
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def environment_back_click_callback(e, win): import page_sensors2 page_sensors2.load_page() def environment_back_press_callback(e, back_image): back_image.set_zoom(280) def environment_back_release_callback(e, back_image): back_image.set_zoo...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_lux.py
Python
apache-2.0
1,353
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" meter = None def back_click_callback(e, win): import page_basic page_basic.load_page() def set_value(indic, v): global meter meter.set_indicator_value(indic, v) def load_page(): global meter scr = lv.obj() scr.set_style_bg_color...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_meter.py
Python
apache-2.0
2,436
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def back_click_callback(e, win): import page_basic page_basic.load_page() def event_cb(e): mbox = e.get_current_target() print("Button %s clicked" % mbox.get_active_btn_text()) def load_page(): scr = lv.obj() scr.set_style_bg_color(l...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_msgbox.py
Python
apache-2.0
896
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def back_click_callback(e, win): import page_basic page_basic.load_page() def event_handler(e): code = e.get_code() obj = e.get_target() if code == lv.EVENT.VALUE_CHANGED: option = " "*10 obj.get_selected_str(option, len(o...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_roller.py
Python
apache-2.0
1,240
import lvgl as lv import _thread import wifi_module from driver import TIMER import font_Alibaba_PuHuiTi RESOURCES_ROOT = "S:/data/pyamp/images/" tim0 = None ap_list = None WIFI_SCAN_CHECK_PERIOD_MS = 2000 # ms WIFI_SCAN_TIMEOUT_MS = 6000 # ms wifi_scan_fail_count = 0 def element_click_callback(e, name): global t...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_scan.py
Python
apache-2.0
4,042
import lvgl as lv import font_Alibaba_PuHuiTi RESOURCES_ROOT = "S:/data/pyamp/images/" def element_click_callback(e, name): print("intent: ", name) if (name == "back" or name == "retry"): import page_scan page_scan.load_page() elif (name == "skip"): import page_haas page_ha...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_scanfail.py
Python
apache-2.0
2,480
import lvgl as lv import font_Alibaba_PuHuiTi RESOURCES_ROOT = "S:/data/pyamp/images/" images = [RESOURCES_ROOT + "temperature.png", RESOURCES_ROOT + "humidity.png", RESOURCES_ROOT + "gas.png", RESOURCES_ROOT + "heartrate.png", RESOURCES_ROOT + "waterlevel.png", RESOU...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_sensors1.py
Python
apache-2.0
4,736
import lvgl as lv import font_Alibaba_PuHuiTi RESOURCES_ROOT = "S:/data/pyamp/images/" images = [RESOURCES_ROOT + "FM.png", RESOURCES_ROOT + "humidity.png", RESOURCES_ROOT + "lux.png", RESOURCES_ROOT + "distance.png", RESOURCES_ROOT + "airpressure.png", RESOURCES_ROOT...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_sensors2.py
Python
apache-2.0
4,736
import lvgl as lv from driver import TIMER RESOURCES_ROOT = "S:/data/pyamp/images/" images = [RESOURCES_ROOT + "wifi.png", RESOURCES_ROOT + "bluetooth.png", RESOURCES_ROOT + "brightness.png", RESOURCES_ROOT + "about.png"] titles = ["Wi-Fi", "Bluetooth", "Brightness",...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_settings.py
Python
apache-2.0
5,979
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" slider_label = None def back_click_callback(e, win): import page_basic page_basic.load_page() def slider_event_cb(e): global slider_label slider = e.get_target() slider_label.set_text("{:d}%".format(slider.get_value())) slider_label....
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_slider.py
Python
apache-2.0
1,167
import lvgl as lv from aliyunIoT import Device import _thread import ujson as json import font_Alibaba_PuHuiTi RESOURCES_ROOT = "S:/data/pyamp/images/" IMAGE_NAME = "plate.jpg" label11 = None label22 = None device = None def element_pressed_cb(e): ele = e.get_target() ele.set_style_bg_color(lv.color_make(0x3...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_solutions.py
Python
apache-2.0
3,784
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def back_click_callback(e, win): import page_basic page_basic.load_page() def load_page(): scr = lv.obj() scr.set_style_bg_color(lv.color_black(), 0) backImg=lv.img(scr) backImg.set_src(RESOURCES_ROOT + "back.png") backImg.set_st...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_spans.py
Python
apache-2.0
1,925
import lvgl as lv import font_Alibaba_PuHuiTi RESOURCES_ROOT = "S:/data/pyamp/images/" def event2_handler(evt): code = evt.get_code() ele = evt.get_target() if code == lv.EVENT.CLICKED: import page_haas page_haas.load_page() elif code == lv.EVENT.PRESSED: ele.set_style_bg_color...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_success.py
Python
apache-2.0
1,378
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def back_click_callback(e, win): import page_basic page_basic.load_page() def event_handler(e): code = e.get_code() obj = e.get_target() if code == lv.EVENT.VALUE_CHANGED: if obj.has_state(lv.STATE.CHECKED): print("Sta...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_switch.py
Python
apache-2.0
1,385
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def back_click_callback(e, win): import page_basic page_basic.load_page() def draw_part_event_cb(e): obj = e.get_target() dsc = lv.obj_draw_part_dsc_t.__cast__(e.get_param()) # If the cells are drawn../ if dsc.part == lv.PART.ITEMS: ...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_table.py
Python
apache-2.0
2,461
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def back_click_callback(e, win): import page_basic page_basic.load_page() def load_page(): scr = lv.obj() scr.set_style_bg_color(lv.color_black(), 0) backImg=lv.img(scr) backImg.set_src(RESOURCES_ROOT + "back.png") backImg.set_st...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_tabview.py
Python
apache-2.0
1,294
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def environment_back_click_callback(e, win): import page_sensors1 page_sensors1.load_page() def environment_back_press_callback(e, back_image): back_image.set_zoom(280) def environment_back_release_callback(e, back_image): back_image.set_zoo...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_temperature.py
Python
apache-2.0
1,416
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" def environment_back_click_callback(e, win): import page_sensors1 page_sensors1.load_page() def environment_back_press_callback(e, back_image): back_image.set_zoom(280) def environment_back_release_callback(e, back_image): back_image.set_zoo...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_waterlevel.py
Python
apache-2.0
1,408
import lvgl as lv import font_Alibaba_PuHuiTi RESOURCES_ROOT = "S:/data/pyamp/images/" def element_pressed_cb(e): ele = e.get_target() ele.set_style_bg_color(lv.color_make(0x39, 0x39, 0x39), 0) def element_released_cb(e): ele = e.get_target() ele.set_style_bg_color(lv.color_make(0xf, 0xf, 0xf), 0) d...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_welcome.py
Python
apache-2.0
1,598
import lvgl as lv import kv import wifi_module import font_Alibaba_PuHuiTi RESOURCES_ROOT = "S:/data/pyamp/images/" wifiImg = [RESOURCES_ROOT + "wifi0.png", RESOURCES_ROOT + "wifi1.png", RESOURCES_ROOT + "wifi2.png", RESOURCES_ROOT + "wifi3.png"] rssi = [3, 2, 1, 0] ssidInfoList = [...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_wifi0.py
Python
apache-2.0
7,630
import lvgl as lv import font_Alibaba_PuHuiTi RESOURCES_ROOT = "S:/data/pyamp/images/" wifiImg = [RESOURCES_ROOT + "wifi0.png", RESOURCES_ROOT + "wifi1.png", RESOURCES_ROOT + "wifi2.png", RESOURCES_ROOT + "wifi3.png"] rssi = [3, 2, 1, 0] ssidInfoList = [[3, "alibaba-inc", False, Tru...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_wifi1.py
Python
apache-2.0
7,417
import lvgl as lv import kv import font_Alibaba_PuHuiTi RESOURCES_ROOT = "S:/data/pyamp/images/" hidenImg = None hiden = False wifiSSID = "" wifiPswd = "" def element_click_callback(e, name): if (name == "back"): import page_scan page_scan.load_page() elif (name == "correct"): if (wif...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_wifi2.py
Python
apache-2.0
3,304
import lvgl as lv import font_Alibaba_PuHuiTi RESOURCES_ROOT = "S:/data/pyamp/images/" hidenImg = None hiden = False wifiSSID = "" wifiPswd = "" def element_click_callback(e, name): if (name == "back"): import page_scan page_scan.load_page() elif (name == "correct"): if (wifiSSID != "...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/page_wifi3.py
Python
apache-2.0
4,941
RESOURCES_ROOT = "S:/data/pyamp/" from environment import Environment from hvac import Hvac from compass import Compass from music import Music from soundttf import SoundTTF from timer import Timer def init(): print("main init") # import SDL as display # import lvgl as lv # lv.init() # display.in...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/smart_panel.py
Python
apache-2.0
6,684
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/" sound_ttf_alive = False def sound_ttf_back_click_callback(e, win): global sound_ttf_alive if (sound_ttf_alive): from smart_panel import load_smart_panel load_smart_panel() sound_ttf_alive = False def sound_ttf_back_press_callback(e,...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/soundttf.py
Python
apache-2.0
3,885
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" class Temperature: scr = None iconImg = None temperatureLable = None unityImg = None tipLabel = None def __init__(self, screen): self.scr = screen self.createTemperatureItem(self.scr, RESOURCES_ROOT + "temperature.png"...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/temperature.py
Python
apache-2.0
1,932
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/" isStarted = False isAnimationComplete = False arc = [None, None, None, None] anim = [None, None, None, None] timeCount = [1, 3, 5, 10] currentSelect = 0 minuteLabel = None secondLabel = None millionLabel = None anim_timeline = None startLabel = None currentValue = 0...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/timer.py
Python
apache-2.0
14,598
import lvgl as lv RESOURCES_ROOT = "S:/data/pyamp/images/" class Waterlevel: scr = None iconImg = None waterlevelLable = None unityLabel = None tipLabel = None def __init__(self, screen): self.scr = screen self.createWaterlevelItem(self.scr, RESOURCES_ROOT + "waterlevel.png",...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/waterlevel.py
Python
apache-2.0
1,957
import utime import sys def wifi_scan(): print('start wifi scan ...') import network sta_if = network.WLAN(network.STA_IF) sta_if.active(True) return(sta_if.scan()) def wifi_connect(wifiSSID, wifiPassword): print('start wifi connect ', wifiSSID) retry = 0 if (sys.platform == "esp32"): ...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ui_collection/wifi_module.py
Python
apache-2.0
1,832
# -*- encoding: utf-8 -*- from aliyunIoT import Device # aliyunIoT组件是连接阿里云物联网平台的组件 import display import utime import ujson # json字串解析库 import netmgr as nm # netmgr是Wi-Fi网络连接的组件 import _thread import urm37 from driver import UART # 物联网平台连接标志位 iot_connected = False # 三元组信息 productKey...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ultrasonic_ranging/m5stackcore2/code/main.py
Python
apache-2.0
3,486
from driver import UART import utime class URM37(object): def __init__(self, uart_obj): self.uart_obj = None if not isinstance(uart_obj, UART): raise ValueError("parameter is not a UART object") self.uart_obj = uart_obj def getRange(self): tx_buf = bytearray([0x22,...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ultrasonic_ranging/m5stackcore2/code/urm37.py
Python
apache-2.0
1,157
# -*- encoding: utf-8 -*- ''' @File : main.py @Description: 紫外线数据上云 @Author : victor.wang @version : 1.0 ''' from aliyunIoT import Device # iot组件是连接阿里云物联网平台的组件 import network # Wi-Fi功能所在库 import utime # 延时API所在组件 from driver import GPIO # E...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ultraviolet_detector/esp32/code/main.py
Python
apache-2.0
6,665
""" Copyright (C) 2015-2021 Alibaba Group Holding Limited `HaaS Python UV sensor` ==================================================== A driver for uv sensor Implementation Notes -------------------- **Hardware:** * HaaS Python uv sensor https://haas.iot.aliyun.com/solution/detail/hardware?versionId=800CDA1EAC39...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ultraviolet_detector/esp32/code/uv.py
Python
apache-2.0
1,734
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- ''' @File : cloudAI.py @Description: 云端AI @Author : jiangyu @version : 1.0 ''' from aliyunIoT import Device import utime # 延时函数在utime库中 import ujson as json class CloudAI : def __gesture_cb(self, dict) : ''' Reply lis...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_congestion_detect/esp32/code/cloudAI.py
Python
apache-2.0
10,770
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- ''' @File : main.py @Description: 车辆拥挤检测案例 @Author : zhangheng @version : 1.0 ''' from aliyunIoT import Device import display # 显示库 import network # 网络库 import ucamera # 摄像头库 import utime # 延时函数在utime库中 import sntp ...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_congestion_detect/esp32/code/main.py
Python
apache-2.0
4,713
from driver import UART from micropyGNSS import MicropyGNSS class Gnss(object): def __init__(self, uartObj): self.uartObj = None if not isinstance(uartObj, UART): raise ValueError("parameter is not a GPIO object") # 初始化定位模组串口 self.uartObj = uartObj self...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_congestion_detect/stm32/code/gnss.py
Python
apache-2.0
892
# -*- coding: UTF-8 -*- from ulinksdk.aliyunIoT import Device # iot组件是连接阿里云物联网平台的组件 import network # Wi-Fi功能所在库 import utime # 延时API所在组件 from driver import UART # UART类,实现串口通信 import gnss # 定位模块gnss传感器类 import ujson import gc uartDev = 0...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_congestion_detect/stm32/code/main.py
Python
apache-2.0
4,628
""" # MicropyGPS - a GPS NMEA sentence parser for Micropython/Python 3.X # Copyright (c) 2017 Michael Calvin McCoy (calvin.mccoy@protonmail.com) # The MIT License (MIT) - see LICENSE file """ """ MIT License Copyright (c) 2017 Calvin McCoy Permission is hereby granted, free of charge, to any person obtaining a copy...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_congestion_detect/stm32/code/micropyGNSS.py
Python
apache-2.0
30,724
from driver import UART from micropyGNSS import MicropyGNSS class Gnss(object): def __init__(self, uartObj): self.uartObj = None if not isinstance(uartObj, UART): raise ValueError("parameter is not a GPIO object") # 初始化定位模组串口 self.uartObj = uartObj self...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_location/ESP-C3-32S-Kit/code/gnss.py
Python
apache-2.0
892
# -*- coding: UTF-8 -*- from aliyunIoT import Device # iot组件是连接阿里云物联网平台的组件 import network # Wi-Fi功能所在库 import utime # 延时API所在组件 from driver import UART # UART类,实现串口通信 import gnss # 定位模块gnss传感器类 import ujson uartDev = 0 gnssDev = 0 # wifi连接的的ssid和...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_location/ESP-C3-32S-Kit/code/main.py
Python
apache-2.0
4,491
""" # MicropyGPS - a GPS NMEA sentence parser for Micropython/Python 3.X # Copyright (c) 2017 Michael Calvin McCoy (calvin.mccoy@protonmail.com) # The MIT License (MIT) - see LICENSE file """ """ MIT License Copyright (c) 2017 Calvin McCoy Permission is hereby granted, free of charge, to any person obtaining a copy...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_location/ESP-C3-32S-Kit/code/micropyGNSS.py
Python
apache-2.0
30,724
from driver import UART from micropyGNSS import MicropyGNSS class Gnss(object): def __init__(self, uartObj): self.uartObj = None if not isinstance(uartObj, UART): raise ValueError("parameter is not a GPIO object") # 初始化定位模组串口 self.uartObj = uartObj self...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_location/ESP-S3-12K-Kit/code/gnss.py
Python
apache-2.0
892
# -*- coding: UTF-8 -*- from aliyunIoT import Device # iot组件是连接阿里云物联网平台的组件 import network # Wi-Fi功能所在库 import utime # 延时API所在组件 from driver import UART # UART类,实现串口通信 import gnss # 定位模块gnss传感器类 import ujson uartDev = 0 gnssDev = 0 # wifi连接的的ssid和...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_location/ESP-S3-12K-Kit/code/main.py
Python
apache-2.0
4,491
""" # MicropyGPS - a GPS NMEA sentence parser for Micropython/Python 3.X # Copyright (c) 2017 Michael Calvin McCoy (calvin.mccoy@protonmail.com) # The MIT License (MIT) - see LICENSE file """ """ MIT License Copyright (c) 2017 Calvin McCoy Permission is hereby granted, free of charge, to any person obtaining a copy...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_location/ESP-S3-12K-Kit/code/micropyGNSS.py
Python
apache-2.0
30,724
from driver import UART from micropyGNSS import MicropyGNSS class Gnss(object): def __init__(self, uartObj): self.uartObj = None if not isinstance(uartObj, UART): raise ValueError("parameter is not a GPIO object") # 初始化定位模组串口 self.uartObj = uartObj self...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_location/esp32/code/gnss.py
Python
apache-2.0
892
# -*- coding: UTF-8 -*- from aliyunIoT import Device # iot组件是连接阿里云物联网平台的组件 import network # Wi-Fi功能所在库 import utime # 延时API所在组件 from driver import UART # UART类,实现串口通信 import gnss # 定位模块gnss传感器类 import ujson uartDev = 0 gnssDev = 0 # wifi连接的的ssid和...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_location/esp32/code/main.py
Python
apache-2.0
4,631
""" # MicropyGPS - a GPS NMEA sentence parser for Micropython/Python 3.X # Copyright (c) 2017 Michael Calvin McCoy (calvin.mccoy@protonmail.com) # The MIT License (MIT) - see LICENSE file """ """ MIT License Copyright (c) 2017 Calvin McCoy Permission is hereby granted, free of charge, to any person obtaining a copy...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_location/esp32/code/micropyGNSS.py
Python
apache-2.0
30,724
from driver import UART from micropyGNSS import MicropyGNSS class Gnss(object): def __init__(self, uartObj): self.uartObj = None if not isinstance(uartObj, UART): raise ValueError("parameter is not a GPIO object") # 初始化定位模组串口 self.uartObj = uartObj self.gnss = ...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_location/haas200/code/gnss.py
Python
apache-2.0
874
# -*- coding: UTF-8 -*- from aliyunIoT import Device # iot组件是连接阿里云物联网平台的组件 import netmgr as nm # Wi-Fi 功能所在库 import utime # 延时API所在组件 from driver import UART # UART类,实现串口通信 import gnss # 定位模块gnss传感器类 import ujson uartDev = 0 gnssDev = 0 # wifi连接的的ssid...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_location/haas200/code/main.py
Python
apache-2.0
4,463
""" # MicropyGPS - a GPS NMEA sentence parser for Micropython/Python 3.X # Copyright (c) 2017 Michael Calvin McCoy (calvin.mccoy@protonmail.com) # The MIT License (MIT) - see LICENSE file """ """ MIT License Copyright (c) 2017 Calvin McCoy Permission is hereby granted, free of charge, to any person obtaining a copy...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_location/haas200/code/micropyGNSS.py
Python
apache-2.0
30,724
# coding=utf-8 from driver import GPIO from driver import UART import network import ujson import utime as time import modem from aliyunIoT import Device import kv #当iot设备连接到物联网平台的时候触发'connect' 事件 def on_connect(data): global module_name,default_ver,productKey,deviceName,deviceSecret,on_trigger,on_download,o...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_location/haas506/code/main.py
Python
apache-2.0
7,125
from driver import UART from micropyGNSS import MicropyGNSS class Gnss(object): def __init__(self, uartObj): self.uartObj = None if not isinstance(uartObj, UART): raise ValueError("parameter is not a GPIO object") # 初始化定位模组串口 self.uartObj = uartObj self.gnss = ...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_location/haaseduk1/code/gnss.py
Python
apache-2.0
910
from aliyunIoT import Device # aliyunIoT组件是连接阿里云物联网平台的组件 import utime import netmgr as nm from driver import UART import gnss import ujson uartDev = 0 gnssDev = 0 # wifi连接的的ssid和pwd定义 wifiSsid = "请填写您的路由器名称" wifiPassword = "请填写您的路由器密码" # 物联网平台相关的key和serect定义 productKey = "产品key" deviceName = "设备名称" devic...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_location/haaseduk1/code/main.py
Python
apache-2.0
4,313
""" # MicropyGPS - a GPS NMEA sentence parser for Micropython/Python 3.X # Copyright (c) 2017 Michael Calvin McCoy (calvin.mccoy@protonmail.com) # The MIT License (MIT) - see LICENSE file """ """ MIT License Copyright (c) 2017 Calvin McCoy Permission is hereby granted, free of charge, to any person obtaining a copy ...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_location/haaseduk1/code/micropyGNSS.py
Python
apache-2.0
30,723
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- ''' @File : cloudAI.py @Description: 云端AI @Author : jiangyu @version : 1.0 ''' from aliyunIoT import Device import utime # 延时函数在utime库中 import ujson as json class CloudAI : def __gesture_cb(self, dict) : ''' Reply lis...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_type_recognization/esp32/code/cloudAI.py
Python
apache-2.0
10,770
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- ''' @File : main.py @Description: 车型识别案例 @Author : zhangheng @version : 1.0 ''' from aliyunIoT import Device import display # 显示库 import network # 网络库 import ucamera # 摄像头库 import utime # 延时函数在utime库中 import sntp # ...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/vehicle_type_recognization/esp32/code/main.py
Python
apache-2.0
4,470
from driver import UART from micropyGNSS import MicropyGNSS class GNSS(object): def __init__(self, uartObj): self.uartObj = None if not isinstance(uartObj, UART): raise ValueError("parameter is not a UART object") # 初始化定位模组串口 self.uartObj = uartObj self.gnss = ...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/weather_forecast/esp32/code/gnss.py
Python
apache-2.0
875
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- ''' @File : main.py @Author : zhangheng @version : 1.0 @Description: 天气预报案例 - 通过gps定位获取该位置近几天的天气状况 board.json - 硬件资源配置文件,详情请参考:https://haas.iot.aliyun.com/haasapi/index.html#/Python/docs/zh-CN/haas_extended_api/driver/driver ''' ...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/weather_forecast/esp32/code/main.py
Python
apache-2.0
6,846
""" # MicropyGPS - a GPS NMEA sentence parser for Micropython/Python 3.X # Copyright (c) 2017 Michael Calvin McCoy (calvin.mccoy@protonmail.com) # The MIT License (MIT) - see LICENSE file """ """ MIT License Copyright (c) 2017 Calvin McCoy Permission is hereby granted, free of charge, to any person obtaining a copy ...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/weather_forecast/esp32/code/micropyGNSS.py
Python
apache-2.0
30,723
from driver import GPIO import utime class Hx711(object): def __init__(self, clkObj, dataObj): self.clkObj = None self.dataObj = None if not isinstance(clkObj, GPIO): raise ValueError("parameter is not an GPIO object") if not isinstance(dataObj, GPIO): raise ...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/weight_scale/haaseduk1/code/ele_scale.py
Python
apache-2.0
2,032
# -*- encoding: utf-8 -*- from driver import SPI from driver import GPIO from aliyunIoT import Device # iot组件是连接阿里云物联网平台的组件 import ujson # json字串解析库 import utime # 延时函数在utime库中 import ele_scale # 引入电子秤驱动库 import sh1106 # 引入hasseduk1 oled屏去掉 import netmgr a...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/weight_scale/haaseduk1/code/main.py
Python
apache-2.0
6,415
from micropython import const import utime import framebuf from driver import SPI from driver import GPIO # register definitions SET_SCAN_DIR = const(0xc0) LOW_COLUMN_ADDRESS = const(0x00) HIGH_COLUMN_ADDRESS = const(0x10) SET_PAGE_ADDRESS = const(0xB0) SET_CONTRAST = const(0x81) SET_ENTIRE_ON = const(0xa4) SET_NORM_I...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/weight_scale/haaseduk1/code/sh1106.py
Python
apache-2.0
7,916
from driver import UART from micropyGNSS import MicropyGNSS class Gnss(object): def __init__(self, uartObj): self.uartObj = None if not isinstance(uartObj, UART): raise ValueError("parameter is not a GPIO object") # 初始化定位模组串口 self.uartObj = uartObj self.gnss = ...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/worst_case/esp32s/code/gnss.py
Python
apache-2.0
874
from driver import GPIO class MagnetronSensor(): def __init__(self, gpioObj): self.gpioObj = None if not isinstance(gpioObj, GPIO): raise ValueError("parameter is not a GPIO object") self.gpioObj = gpioObj def isMagnetic(self): if self.gpioObj is None: ...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/worst_case/esp32s/code/magnetronSensor.py
Python
apache-2.0
419
# -*- encoding: utf-8 -*- from aliyunIoT import Device # iot组件是连接阿里云物联网平台的组件 from driver import GPIO from driver import TIMER # 定时器类 from driver import PWM # PWM类 from driver import ADC # ADC类 from driver import I2C # I2C类 from driver import UART # UART类 from driver import SPI #...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/worst_case/esp32s/code/main.py
Python
apache-2.0
13,178
from driver import SPI,GPIO class AuthenticationError(Exception): pass class StatusNotSuccessError(Exception): pass class MFRC522: KEY = [0xFF,0xFF,0xFF,0xFF,0xFF,0xFF] BLOCK_ADDRS = [8, 9, 10] MAX_LEN = 16 PCD_IDLE = 0x00 PCD_AUTHENT = 0x0E PCD_RECEIVE = 0x08 PCD_TRANSMIT = 0x0...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/worst_case/esp32s/code/mfrc522.py
Python
apache-2.0
14,352
""" # MicropyGPS - a GPS NMEA sentence parser for Micropython/Python 3.X # Copyright (c) 2017 Michael Calvin McCoy (calvin.mccoy@protonmail.com) # The MIT License (MIT) - see LICENSE file """ """ MIT License Copyright (c) 2017 Calvin McCoy Permission is hereby granted, free of charge, to any person obtaining a copy...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/worst_case/esp32s/code/micropyGNSS.py
Python
apache-2.0
30,724
""" Copyright (C) 2015-2021 Alibaba Group Holding Limited HaaS Python driver for motorspeed Author: HaaS Date: 2022/05/15 """ from driver import GPIO class MOTORSPEED(object): def __init__(self, gpioObj, func=None): self.gpioObj = None if not isinstance(gpioObj, GPIO): ...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/worst_case/esp32s/code/motorspeed.py
Python
apache-2.0
637
""" Copyright (C) 2015-2021 Alibaba Group Holding Limited HaaS Python's driver for MPU6050 Author: HaaS Python Team Date: 2022/02/02 """ from micropython import const from driver import I2C from utime import sleep_ms import math MPU_SELF_TESTX_REG = const(0X0D) #自检寄存器X MPU_SELF_TESTY_REG = const(0X0...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/worst_case/esp32s/code/mpu6050.py
Python
apache-2.0
10,409
from driver import ADC class PHOTORESISTOR(object): def __init__(self, adcObj): self.adcObj = None if not isinstance(adcObj, ADC): raise ValueError("parameter is not an ADC object") self.adcObj = adcObj def getLightness(self): if self.adcObj is None: r...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/worst_case/esp32s/code/photoresistor.py
Python
apache-2.0
422
""" HaaSPython PWM driver for servo 舵机传感器驱动 """ from driver import PWM class SERVO(object): def __init__(self, pwmObj): self.pwmObj = None if not isinstance(pwmObj, PWM): raise ValueError("parameter is not an PWM object") self.pwmObj = pwmObj def setOptionSero(self,data)...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/worst_case/esp32s/code/servo.py
Python
apache-2.0
664
""" Copyright (C) 2015-2021 Alibaba Group Holding Limited MicroPython's driver for CHT8305 Author: HaaS Date: 2021/09/14 """ from micropython import const import utime from driver import I2C ''' # sht3x commands definations # read serial number: CMD_READ_SERIALNBR 0x3780 # ...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/worst_case/esp32s/code/sht3x.py
Python
apache-2.0
3,599
""" Copyright (C) 2015-2021 Alibaba Group Holding Limited MicroPython's driver for ULN2003 Author: HaaS Date: 2022/03/15 """ from driver import GPIO from utime import sleep_ms from micropython import const import math class ULN2003(object): """ This class implements uln2003 chip's defs. "...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/worst_case/esp32s/code/uln2003.py
Python
apache-2.0
2,207
# -*- coding:gbk -*- import random # 随机数生成库 import ujson # json字串解析库 import utime # 延时API所在组件 import network # Wi-Fi功能所在库 from aliyunIoT import Device # 连接阿里云物联网平台的组件 from machine import Pin # 引脚控制 from neoPixelMatrix import NeoPixelMa...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ws2812_matrix/esp32/code/main.py
Python
apache-2.0
6,837
import neopixel import framebuf class NeoPixelMatrix: def __init__(self, pin, width, hight, linedir): self.width = width self.height = hight self.linedir = linedir self.buffer = bytearray(self.width * self.height * 3) fb = framebuf.FrameBuffer( self.buffer, self...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ws2812_matrix/esp32/code/neoPixelMatrix.py
Python
apache-2.0
1,593
import random # 随机数生成库 import neopixel # ws2812驱动库 import machine # 设备驱动库 import ujson # json字串解析库 import utime # 延时API所在组件 import network # Wi-Fi功能所在库 from aliyunIoT import Device # 连接阿里云物联网平台的组件 # 灯带点亮模式 ligh...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ws2812_strip/esp32/code/main.py
Python
apache-2.0
5,777
# coding=utf-8 from driver import GPIO from ws2812 import WS2812 from driver import SPI import network import ujson import utime as time import modem from aliyunIoT import Device import kv #当iot设备连接到物联网平台的时候触发'connect' 事件 def on_connect(data): global module_name,default_ver,productKey,deviceName,deviceSecret,o...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ws2812_strip/haas506/code/main.py
Python
apache-2.0
5,890
import utime as time class WS2812: """ Driver for WS2812 RGB LEDs. May be used for controlling single LED or chain of LEDs. Example of use: chain = WS2812(spi_bus=1, led_count=4) data = [ (255, 0, 0), # red (0, 255, 0), # green (0, 0, 255), #...
YifuLiu/AliOS-Things
haas_lib_bundles/python/docs/examples/ws2812_strip/haas506/code/ws2812.py
Python
apache-2.0
6,137
""" Copyright (C) 2015-2021 Alibaba Group Holding Limited `HaaS Python ads1x15` ==================================================== A driver for ads1x15 * Author(s): HaaS Group Implementation Notes -------------------- **Hardware:** * HaaS Python ads1x15 https://haas.iot.aliyun.com/solution/detail/hardware **S...
YifuLiu/AliOS-Things
haas_lib_bundles/python/libraries/ads1115/ads1x15.py
Python
apache-2.0
6,561
""" Copyright (C) 2015-2021 Alibaba Group Holding Limited `HaaS Python adxl34x` ==================================================== A driver for the ADXL34x 3-axis accelerometer family * Author(s): HaaS Group Based on drivers by Bryan Siepert, K. Townsend and Tony DiCola Implementation Notes -------------------- ...
YifuLiu/AliOS-Things
haas_lib_bundles/python/libraries/adxl34x/adxl34x.py
Python
apache-2.0
19,664
""" Copyright (C) 2015-2021 Alibaba Group Holding Limited MicroPython's driver for CHT8305 Author: HaaS Date: 2021/09/14 """ import utime from micropython import const from driver import I2C #AHT21B_I2CADDR_DEFAULT = const(0x38) # Default I2C address AHT21B_CMD_CALIBRATE = const(0xE1) # Calibration ...
YifuLiu/AliOS-Things
haas_lib_bundles/python/libraries/aht21b/aht21b.py
Python
apache-2.0
4,655
""" Copyright (C) 2015-2020 Alibaba Group Holding Limited The driver for AP3216C chip, The AP3216C is an integrated ALS & PS module that includes a digital ambient light sensor [ALS], a proximity sensor [PS], and an IR LED in a single package. """ from micropython import const from driver import I2C from utime import ...
YifuLiu/AliOS-Things
haas_lib_bundles/python/libraries/ap3216c/ap3216c.py
Python
apache-2.0
13,749