当前位置: 首页 > news >正文

5.35 综合案例2.0 -称重数据上传云端

综合案例2.0 - 称重数据上传云端

  • 案例说明
  • 连线
  • 功能实现
    • 1.阿里云平台连接
  • 代码
    • 应用开发
      • 3.1新建‘普通项目’
      • 3.2关联产品和设备
      • 3.3新建‘移动应用’
      • 3.4添加组件
      • 3.5配置组件信息
      • 3.6保存预览

案例说明

使用hx711串口模块称重,结合IOT studio制作手机APP远程控制并采集物体重量。

  • hx711串口模块用多种使用模式,这里只使用方式1,指令0xA1。
  • 使用流程
    • 手机APP界面如下在这里插入图片描述
    • 1,用于显示物体重量
    • 2,用于矫正称重的精准度物体重量计算公式:实际重量=传感器数据/K; // K 是一个系数,通过调节K值调节称的精准度。
    • 3,去皮是去掉装物品的篮子之类的容器的重量,可以准确称出称量物的实际重量。先按去皮按钮,重量显示为零,再把要秤的物品放进容器里,显示的就是物品的实际重量了。
    • 4,称重,在模式1下,每次按下称重才会将当前物体的重量显示在APP或OLED屏幕上.
    • 5,进行模式切换,模式一的情况下每次按下称重才会显示当前重量。模式二的情况下当称上物体重量发生变化就会显示数据,每秒显示一次。

请添加图片描述

连线

hx711安装焊接参考使用说明
在这里插入图片描述

hx711模块需要使用5v供电,注意vcc连线
在这里插入图片描述

功能实现

1.阿里云平台连接

阿里云环境创建参考高级组件库-aliyunIoT进行搭建。
创建产品,添加产品后添加物模型。
在这里插入图片描述

代码

在这里插入图片描述
main.py

import utime as time
from driver import UART
from driver import GPIO
from ssd1306 import SSD1306_128_64
import aliyun
import hx711
from driver import TIMER#A通道指令:模式1发送一直指令获取一次重量/模式2每隔1000ms获取一次物体重量
MODEL1_PASSIVITY_A  = b'\xA1'disp=SSD1306_128_64()
#实例化key1
key1=GPIO(10,10)
key1.open("KEY1")# 初始化oled
disp.begin()
disp.clear()    #清屏 
readBuf=bytearray(10)
weight_state=False
modle=1
maopi_on=False
GapValue=430
key=False
Weight_Shiwu=0def modle1():global Weight_Shiwu,weight_state,GapValuedisp.oled_showStr(110,0,'1',2)if weight_state:Weight_Shiwu=get_weight()disp.oled_showStr(85,0,'md:',2)disp.oled_showStr(110,0,'1',2)disp.oled_showStr(50,3,'            ',2)disp.oled_showStr(50,5,'            ',2)disp.oled_showStr(0,3,'Weight:',2)disp.oled_showStr(50,3,str(Weight_Shiwu),2)aliyun.update("weight",Weight_Shiwu)weight_state=Falsealiyun.re_weight_state(0)Weight_Shiwu_2=0
def modle2(args):global Weight_Shiwu,Weight_Shiwu_2,modleif (modle ==2):Weight_Shiwu=get_weight()if Weight_Shiwu_2!=Weight_Shiwu:disp.oled_showStr(85,0,'md:',2)disp.oled_showStr(110,0,'2',2)disp.oled_showStr(50,3,'            ',2)disp.oled_showStr(50,5,'            ',2)disp.oled_showStr(0,3,'Weight:',2)disp.oled_showStr(50,3,str(Weight_Shiwu),2)aliyun.update("weight",Weight_Shiwu)Weight_Shiwu_2=Weight_Shiwutimer = TIMER(0)
timer.open(period=1000, mode=TIMER.PERIODIC, callback=modle2)#中断回调函数
def key1_callback(args):global weight_statetime.sleep(1)weight_state=Truekey1.disableIrq()key1.clearIrq()def enable_key():#开启中断key1.enableIrq(key1_callback)Weight_Maopi=0
def Get_Maopi():global Weight_MaopiWeight_Maopi =hx711.hx711_read()print('Weight_Maopi',Weight_Maopi)def get_weight():global Weight_Maopi,GapValueWeight_1 = hx711.hx711_read()Weight_1= Weight_Maopi-Weight_1if Weight_1>=0:i=1Weight_1=round((float(Weight_1)/GapValue),1)print('Weight_1:',i*Weight_1)else:i=-1Weight_1=0-Weight_1Weight_1=round((float(Weight_1)/GapValue),1)print('Weight_1:',i*Weight_1)return i*Weight_1def main():global weight_state,GapValue,modle,maopi_on,Weight_Shiwu,Weight_Maopi#等待阿里云连接aliyun.connect()while  not aliyun.get_connect_state():time.sleep_ms(10)hx711.writechar(MODEL1_PASSIVITY_A)     #默认模式1time.sleep_ms(200)Get_Maopi()time.sleep_ms(200)Get_Maopi()Weight_Shiwu=get_weight()aliyun.update("Maopi",maopi_on)aliyun.update("weight_state",weight_state)aliyun.update("k",GapValue)aliyun.update("modle",modle)aliyun.update("weight",Weight_Shiwu)#打开按键使能enable_key()disp.oled_showStr(85,0,'md:',2)disp.oled_showStr(110,0,'1',2)disp.oled_showStr(50,3,'            ',2)disp.oled_showStr(50,5,'            ',2)disp.oled_showStr(0,3,'Weight:',2)disp.oled_showStr(50,3,str(Weight_Shiwu),2)while True:if maopi_on:Get_Maopi()Weight_Shiwu=get_weight()disp.oled_showStr(50,3,'            ',2)disp.oled_showStr(50,5,'            ',2)disp.oled_showStr(0,3,'Weight:',2)disp.oled_showStr(50,3,str(Weight_Shiwu),2)aliyun.update("weight",Weight_Shiwu)aliyun.re_maopi(0)if modle ==1:modle1()maopi_on=aliyun.get_maopi()weight_state=aliyun.get_weight_state()GapValue=aliyun.get_k()modle=aliyun.get_modle()time.sleep_ms(100)if __name__ == '__main__':main()

aliyun.py

注意更改产品信息

# coding=utf-8
import network
import ujson
import utime as time
import modem
from  aliyunIoT import Device
import ota
import kv#更改产品信息
###############################
productKey = "*******"
productSecret = "**************"
###############################
global deviceName,g_connect_status,device_dyn_resigter_succed,netw
g_connect_status = False
netw = None
device = None
deviceSecret = None
device_dyn_resigter_succed = False#初始化物联网平台Device类,获取device实例
device = Device()
# 定义需要升级的模块和版本号
module_name = 'default'
app_version = '1.0.1'
# 定义升级包的下载和安装路径,其中url,hash_type和hash 会通过服务端推送被保存下来
info = {'url': '','store_path': '/data/pyamp/app.zip','install_path': '/data/pyamp/','length': 0,'hash_type': '','hash': ''
}# ota 消息推送的接受函数
def on_trigger(data):global info# 保存服务端推送的ota信息info['url'] = data['url']info['length'] = data['length']info['module_name'] = data['module_name']info['version'] = data['version']info['hash'] = data['hash']info['hash_type'] = data['hash_type']# 开始ota 包下载dl_data = {}dl_data['url'] = info['url']dl_data['store_path'] = info['store_path']ota.download(dl_data)# ota 升级包下载结果回调函数
def on_download(data):global infoif data >= 0:print('Ota download succeed')# 开始ota包校验param = {}param['length'] = info['length']param['store_path'] = info['store_path']param['hash_type'] = info['hash_type']param['hash'] = info['hash']ota.verify(param)# ota 升级包校验结果回调函数
def on_verify(data):global infoprint(data)if data >= 0 :print('Ota verify succeed')print('Start Upgrade')# 开始ota升级param = {}param['length'] = info['length']param['store_path'] = info['store_path']param['install_path'] = info['install_path']ota.upgrade(param)# ota 升级包结果回调函数
def on_upgrade(data):if data >= 0 :print('Ota succeed')#ota升完级后 重启设备reboot()connect_state = False
def get_connect_state():global connect_statereturn connect_state
#当iot设备连接到物联网平台的时候触发'connect' 事件
def on_connect(data):global module_name,default_ver,productKey,deviceName,deviceSecret,on_trigger,on_download,on_verify,on_upgrade,connect_stateprint('***** connect lp succeed****')data_handle = {}data_handle['device_handle'] = device.getDeviceHandle()# 初始化ota服务ota.init(data_handle)connect_state = True# ota 回调函数注册ota.on(1,on_trigger)ota.on(2,on_download)ota.on(3,on_verify)ota.on(4,on_upgrade)report_info = {"device_handle": data_handle['device_handle'],"product_key": productKey ,"device_name": deviceName ,"module_name": module_name ,"version": app_version}# 上报本机ota相关信息,上报版本信息返回以后程序返回,知道后台推送ota升级包,才会调用on_trigger函数ota.report(report_info)   def re_maopi(ret):global MaopiMaopi = retupdate('Maopi',Maopi)def re_weight_state(ret):global weight_stateweight_state = retupdate('weight_state',weight_state)Maopi=False
def get_maopi():global Maopireturn Maopiweight_state=False
def get_weight_state():global weight_statereturn weight_statek=430
def get_k():global kreturn kmodle=1
def get_modle():global modlereturn modle#当iot云端下发属性设置时,触发'props'事件
def on_props(request):global Maopi,weight_state,k,modleprint('clound req data is {}'.format(request))# # # #获取消息中的params数据params=request['params']# #去除字符串的'',得到字典数据params=eval(params)if "Maopi" in params :Maopi = params["Maopi"]if "weight_state" in params :weight_state = params["weight_state"]    if "k" in params :k = params["k"]if "modle" in params :modle = params["modle"]#当连接断开时,触发'disconnect'事件
def on_disconnect():print('linkkit is disconnected')#当iot云端调用设备service时,触发'service'事件
def on_service(id,request):print('clound req id  is {} , req is {}'.format(id,request))
#当设备跟iot平台通信过程中遇到错误时,触发'error'事件
def on_error(err):print('err msg is {} '.format(err))#网络连接的回调函数
def on_4g_cb(args):global g_connect_statuspdp = args[0]netwk_sta = args[1]if netwk_sta == 1:g_connect_status = Trueelse:g_connect_status = False#网络连接
def connect_network():global netw,on_4g_cb,g_connect_status#NetWorkClient该类是一个单例类,实现网络管理相关的功能,包括初始化,联网,状态信息等.netw = network.NetWorkClient()g_register_network = Falseif netw._stagecode is not None and netw._stagecode == 3 and netw._subcode == 1:g_register_network = Trueelse:g_register_network = Falseif g_register_network:#注册网络连接的回调函数on(self,id,func);  1代表连接,func 回调函数  ;return 0 成功netw.on(1,on_4g_cb)netw.connect(None)else:print('网络注册失败')while True:if g_connect_status:print('网络连接成功')breaktime.sleep_ms(20)#动态注册回调函数
def on_dynreg_cb(data):global deviceSecret,device_dyn_resigter_succeddeviceSecret = datadevice_dyn_resigter_succed = True# 连接物联网平台
def dyn_register_device(productKey,productSecret,deviceName):global on_dynreg_cb,device,deviceSecret,device_dyn_resigter_succedkey = '_amp_customer_devicesecret'deviceSecretdict = kv.get(key)print("deviceSecretdict:",deviceSecretdict)if isinstance(deviceSecretdict,str):    deviceSecret = deviceSecretdict if deviceSecretdict is None or deviceSecret is None:key_info = {'productKey': productKey  ,'productSecret': productSecret ,'deviceName': deviceName}# 动态注册一个设备,获取设备的deviceSecret#下面的if防止多次注册,当前若是注册过一次了,重启设备再次注册就会卡住,if not device_dyn_resigter_succed:device.register(key_info,on_dynreg_cb)  def connect():global deviceName,g_connect_status,device_dyn_resigter_succeddeviceName = None# 获取设备的IMEI 作为deviceName 进行动态注册deviceName = modem.info.getDevImei()# 连接网络connect_network()if deviceName is not None and len(deviceName) > 0 :#动态注册一个设备dyn_register_device(productKey,productSecret,deviceName)else:print("获取设备IMEI失败,无法进行动态注册")while deviceSecret is None:time.sleep(0.2)print('动态注册成功:' + deviceSecret)key_info = {'region' : 'cn-shanghai' ,'productKey': productKey ,'deviceName': deviceName ,'deviceSecret': deviceSecret ,'keepaliveSec': 60,}#打印设备信息print(key_info)#device.ON_CONNECT 是事件,on_connect是事件处理函数/回调函数device.on(device.ON_CONNECT,on_connect)device.on(device.ON_DISCONNECT,on_disconnect)device.on(device.ON_PROPS,on_props)device.on(device.ON_SERVICE,on_service)device.on(device.ON_ERROR,on_error)device.connect(key_info)def update(key,value):global devicepost_data_str=ujson.dumps({key:value})data={"params":post_data_str}device.postProps(data)

hx711.py

'''
A通道采集数据增益128倍,精度更高.B通道增益只有32倍
波特率9600bps,无校验位,停止位1,返回数据10字节.
串口模块只需发送对应指令即可控制HX711.
工作方式1只读取数据,需要自己计算重量
工作方式2需要校准,调整系数k
案例使用工作方式1,
'''
from driver import UART
import utime as time#A通道指令:模式1发送一直指令获取一次重量/模式2每隔100ms获取一次物体重量
MODEL1_PASSIVITY_A  = b'\xA1'
# MODEL1_INITIATIVE_A = b'\xA2'
# MODEL2_PASSIVITY_A  = b'\xA3'
# MODEL2_INITIATIVE_A = b'\xA4'
# RECTIFY_A = b'\xA5'
# QUPI_A = b'\xAA'
# ADD_A = b'\xAB'
# SUBTRACT_A = b'\xA5'
# K_430 = b'\xA6'
# K_210 = b'\xA7'
# K_106 = b'\xA8'
# K_26 = b'\xA9'# #B通道指令
# MODEL1_PASSIVITY_B  = b'\xB1'
# MODEL1_INITIATIVE_B = b'\xB2'
# MODEL2_PASSIVITY_B  = b'\xB3'
# MODEL2_INITIATIVE_B = b'\xB4'
# RECTIFY_B = b'\xB5'
# QUPI_B = b'\xBA'#串口实例化
uart0=UART()
uart0.open("serial1")def writechar(char):uart0.write(bytearray(char))def hx711_read():writechar(MODEL1_PASSIVITY_A)readBuf=bytearray(10)ret = uart0.read(readBuf)#print(readBuf)if ret>0:if (readBuf[0]==0XAA and readBuf[9]==0XFF):if((readBuf[7]*256+readBuf[8])==(readBuf[1]+readBuf[2]+readBuf[3]+readBuf[4]+readBuf[5]+readBuf[6])):Weight=readBuf[4]*65536+readBuf[5]*256+readBuf[6]print('getWeight',Weight)  return Weightelse:print('get data false')else :return 0

OLED显示屏代码
ssd1306.py


import utime as time
import codetab# Constants
SSD1306_I2C_ADDRESS = 0x3C    # 011110+SA0+RW - 0x3C or 0x3D
SSD1306_SETCONTRAST = 0x81
SSD1306_DISPLAYALLON_RESUME = 0xA4
SSD1306_DISPLAYALLON = 0xA5
SSD1306_NORMALDISPLAY = 0xA6
SSD1306_INVERTDISPLAY = 0xA7
SSD1306_DISPLAYOFF = 0xAE
SSD1306_DISPLAYON = 0xAF
SSD1306_SETDISPLAYOFFSET = 0xD3
SSD1306_SETCOMPINS = 0xDA
SSD1306_SETVCOMDETECT = 0xDB
SSD1306_SETDISPLAYCLOCKDIV = 0xD5
SSD1306_SETPRECHARGE = 0xD9
SSD1306_SETMULTIPLEX = 0xA8
SSD1306_SETLOWCOLUMN = 0x00
SSD1306_SETHIGHCOLUMN = 0x10
SSD1306_SETSTARTLINE = 0x40
SSD1306_MEMORYMODE = 0x20
SSD1306_COLUMNADDR = 0x21
SSD1306_PAGEADDR = 0x22
SSD1306_COMSCANINC = 0xC0
SSD1306_COMSCANDEC = 0xC8
SSD1306_SEGREMAP = 0xA0
SSD1306_CHARGEPUMP = 0x8D
SSD1306_EXTERNALVCC = 0x1
SSD1306_SWITCHCAPVCC = 0x2# Scrolling constants
SSD1306_ACTIVATE_SCROLL = 0x2F
SSD1306_DEACTIVATE_SCROLL = 0x2E
SSD1306_SET_VERTICAL_SCROLL_AREA = 0xA3
SSD1306_RIGHT_HORIZONTAL_SCROLL = 0x26
SSD1306_LEFT_HORIZONTAL_SCROLL = 0x27
SSD1306_VERTICAL_AND_RIGHT_HORIZONTAL_SCROLL = 0x29
SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL = 0x2Aclass SSD1306Base(object):def __init__(self, width, height):self.width = widthself.height = heightself._pages = height//8self._buffer = [0]*(width*self._pages)# Handle hardware I2Cfrom driver import I2Cself._i2c=I2C()self._i2c.open('OLED')def _initialize(self):raise NotImplementedErrordef writeCmd(self, command):"""Send command byte to display."""# I2C write.control = 0x00   # Co = 0, DC = 0# writeBuf=bytearray(2)# writeBuf[0]=control# writeBuf[1]=command# self._i2c.write(writeBuf)writeBuf=bytearray(1)writeBuf[0]=commandself._i2c.memWrite(writeBuf,control,8)def writeDat(self, data):"""Send byte of data to display."""# I2C write.control = 0x40   # Co = 0, DC = 0# writeBuf=bytearray(2)# writeBuf[0]=control# writeBuf[1]=data# self._i2c.write(writeBuf)writeBuf=bytearray(1)writeBuf[0]=dataself._i2c.memWrite(writeBuf,control,8)def begin(self, vccstate=SSD1306_SWITCHCAPVCC):"""Initialize display."""# Save vcc state.self._vccstate = vccstate# Reset and initialize display.# self.reset()self._initialize()# Turn on the display.self.writeCmd(SSD1306_DISPLAYON)# --------------------------------------------------------------
#  Prototype      : oled_fill(fill_data)
#  Parameters     : fill_data,范围0x00-0xff
#  Description    : 全屏填充,例如 0x00-全黑,0xff全亮
# --------------------------------------------------------------def oled_fill(self,fill_data):for i in range(8):#page0-page1self.writeCmd(0xb0+i)# low colum start addressself.writeCmd(0x00)#high colum start addressself.writeCmd(0x10)for i in range(128*64):self.writeDat(fill_data)  # --------------------------------------------------------------
#  Prototype      : clear()
#  Parameters     : none
#  Description    : 全黑
# --------------------------------------------------------------def clear(self):self.oled_fill(0x00)# --------------------------------------------------------------
#  Prototype      : oled_setPos(x,y)
#  Parameters     : x,y -- 起始点坐标(x:0~127, y:0~7)
#  Description    : 设置起始坐标
# --------------------------------------------------------------def oled_setPos(self,x,y):self.writeCmd(0xb0+y)self.writeCmd(((x&0xf0)>>4)|0x10)self.writeCmd((x&0x0f)|0x01)# --------------------------------------------------------------
#  Prototype      : oled_showCN(x,y,n)
#  Parameters     : x,y -- 起始点坐标(x:0~127, y:0~7); N:汉字在codetab.h中的索引
#  Description    : 显示codetab.py中的汉字,16*16点阵
# --------------------------------------------------------------def oled_showCN(self,x,y,n):self.oled_setPos(x,y)adder=32*nfor i in range(16):self.writeDat(codetab.F1[adder])adder+=1self.oled_setPos(x,y+1)for i in range(16):self.writeDat(codetab.F1[adder])adder+=1# --------------------------------------------------------------
#  Prototype      : oled_showStr(x,y,ch,TextSize)
#  Parameters     : x,y -- 起始点坐标(x:0~127, y:0~7); ch[] -- 要显示的字符串; TextSize -- 字符大小(1:6*8 ; 2:8*16)
#  Description    : 显示codetab.py中的ASCII字符,有6*8和8*16可选择
# --------------------------------------------------------------    def oled_showStr(self,x,y,ch,TextSize):c=0j=0if TextSize==1:while ch[j]!='\0':#ord()将字符转换成十进制,如'a'->97c=ord(ch[j])-32if x>126:x=0y+=1self.oled_setPos(x,y)for i in range(6):self.writeDat(codetab.F6x8[c][i]) x+=6j+=1#防止index out of range if j==len(ch):breakif TextSize==2:while ch[j]!='\0':#ord()将字符转换成十进制,如'a'->97c=ord(ch[j])-32if x>120:x=0y+=1self.oled_setPos(x,y)for i in range(8):self.writeDat(codetab.F8X16[c*16+i]) self.oled_setPos(x,y+1)for i in range(8):self.writeDat(codetab.F8X16[c*16+i+8])    x+=8j+=1    #防止index out of range                                    if j==len(ch):break
# --------------------------------------------------------------
# Prototype      : oled_showPicture(x0,y0,x1,y1,BMP)
# Parameters     : x0,y0 -- 起始点坐标(x0:0~127, y0:0~7); x1,y1 -- 起点对角线(结束点)的坐标(x1:1~128,y1:128)
# Description    : 显示BMP位图
# --------------------------------------------------------------def oled_showPicture(self,x0,y0,x1,y1,BMP):i=0if y1%8==0:y=y1/8else:y=y1/8+1for y in range(y0,y1):self.oled_setPos(x0,y)   for x in range(x0,x1):self.writeDat(BMP[i])  i+=1    if i==len(BMP) :break# --------------------------------------------------------------
# Prototype      : set_contrast(contrast)
# Parameters     : coontrast,取值范围为0-255
# Description    : 对比度/亮度调节
# --------------------------------------------------------------    def set_contrast(self, contrast):if contrast < 0 or contrast > 255:raise ValueError('Contrast must be a value from 0 to 255 (inclusive).')self.writeCmd(SSD1306_SETCONTRAST)self.writeCmd(contrast)class SSD1306_128_64(SSD1306Base):def __init__(self):super(SSD1306_128_64, self).__init__(128, 64)def _initialize(self):# 128x64 pixel specific initialization.self.writeCmd(SSD1306_DISPLAYOFF)                    # 0xAEself.writeCmd(SSD1306_SETDISPLAYCLOCKDIV)            # 0xD5self.writeCmd(0x80)                                  # the suggested ratio 0x80self.writeCmd(SSD1306_SETMULTIPLEX)                  # 0xA8self.writeCmd(0x3F)self.writeCmd(SSD1306_SETDISPLAYOFFSET)              # 0xD3self.writeCmd(0x0)                                   # no offsetself.writeCmd(SSD1306_SETSTARTLINE | 0x0)            # line #0self.writeCmd(SSD1306_CHARGEPUMP)                    # 0x8Dif self._vccstate == SSD1306_EXTERNALVCC:self.writeCmd(0x10)else:self.writeCmd(0x14)self.writeCmd(SSD1306_MEMORYMODE)                    # 0x20self.writeCmd(0x00)                                  # 0x0 act like ks0108self.writeCmd(SSD1306_SEGREMAP | 0x1)self.writeCmd(SSD1306_COMSCANDEC)self.writeCmd(SSD1306_SETCOMPINS)                    # 0xDAself.writeCmd(0x12)self.writeCmd(SSD1306_SETCONTRAST)                   # 0x81if self._vccstate == SSD1306_EXTERNALVCC:self.writeCmd(0x9F)else:self.writeCmd(0xCF)self.writeCmd(SSD1306_SETPRECHARGE)                  # 0xd9if self._vccstate == SSD1306_EXTERNALVCC:self.writeCmd(0x22)else:self.writeCmd(0xF1)self.writeCmd(SSD1306_SETVCOMDETECT)                 # 0xDBself.writeCmd(0x40)self.writeCmd(SSD1306_DISPLAYALLON_RESUME)           # 0xA4self.writeCmd(SSD1306_NORMALDISPLAY)                 # 0xA6class SSD1306_128_32(SSD1306Base):def __init__(self):super(SSD1306_128_32, self).__init__(128, 32)def _initialize(self):self.writeCmd(SSD1306_DISPLAYOFF)                    # 0xAEself.writeCmd(SSD1306_SETDISPLAYCLOCKDIV)            # 0xD5self.writeCmd(0x80)                                  # the suggested ratio 0x80self.writeCmd(SSD1306_SETMULTIPLEX)                  # 0xA8self.writeCmd(0x1F)self.writeCmd(SSD1306_SETDISPLAYOFFSET)              # 0xD3self.writeCmd(0x0)                                   # no offsetself.writeCmd(SSD1306_SETSTARTLINE | 0x0)            # line #0self.writeCmd(SSD1306_CHARGEPUMP)                    # 0x8Dif self._vccstate == SSD1306_EXTERNALVCC:self.writeCmd(0x10)else:self.writeCmd(0x14)self.writeCmd(SSD1306_MEMORYMODE)                    # 0x20self.writeCmd(0x00)                                  # 0x0 act like ks0108self.writeCmd(SSD1306_SEGREMAP | 0x1)self.writeCmd(SSD1306_COMSCANDEC)self.writeCmd(SSD1306_SETCOMPINS)                    # 0xDAself.writeCmd(0x02)self.writeCmd(SSD1306_SETCONTRAST)                   # 0x81self.writeCmd(0x8F)self.writeCmd(SSD1306_SETPRECHARGE)                  # 0xd9if self._vccstate == SSD1306_EXTERNALVCC:self.writeCmd(0x22)else:self.writeCmd(0xF1)self.writeCmd(SSD1306_SETVCOMDETECT)                 # 0xDBself.writeCmd(0x40)self.writeCmd(SSD1306_DISPLAYALLON_RESUME)           # 0xA4self.writeCmd(SSD1306_NORMALDISPLAY)                 # 0xA6class SSD1306_96_16(SSD1306Base):def __init__(self):super(SSD1306_96_16, self).__init__(96, 16)def _initialize(self):self.writeCmd(SSD1306_DISPLAYOFF)                    # 0xAEself.writeCmd(SSD1306_SETDISPLAYCLOCKDIV)            # 0xD5self.writeCmd(0x60)                                  # the suggested ratio 0x60self.writeCmd(SSD1306_SETMULTIPLEX)                  # 0xA8self.writeCmd(0x0F)self.writeCmd(SSD1306_SETDISPLAYOFFSET)              # 0xD3self.writeCmd(0x0)                                   # no offsetself.writeCmd(SSD1306_SETSTARTLINE | 0x0)            # line #0self.writeCmd(SSD1306_CHARGEPUMP)                    # 0x8Dif self._vccstate == SSD1306_EXTERNALVCC:self.writeCmd(0x10)else:self.writeCmd(0x14)self.writeCmd(SSD1306_MEMORYMODE)                    # 0x20self.writeCmd(0x00)                                  # 0x0 act like ks0108self.writeCmd(SSD1306_SEGREMAP | 0x1)self.writeCmd(SSD1306_COMSCANDEC)self.writeCmd(SSD1306_SETCOMPINS)                    # 0xDAself.writeCmd(0x02)self.writeCmd(SSD1306_SETCONTRAST)                   # 0x81self.writeCmd(0x8F)self.writeCmd(SSD1306_SETPRECHARGE)                  # 0xd9if self._vccstate == SSD1306_EXTERNALVCC:self.writeCmd(0x22)else:self.writeCmd(0xF1)self.writeCmd(SSD1306_SETVCOMDETECT)                 # 0xDBself.writeCmd(0x40)self.writeCmd(SSD1306_DISPLAYALLON_RESUME)           # 0xA4self.writeCmd(SSD1306_NORMALDISPLAY)                 # 0xA6

codetab.py


##*--  文字:  煜  --*#
##*--  文字:  瑛  --*#
##*--  文字:  物  --*#
##*--  文字:  联  --*#
##*--  文字:  网  --*#
##*--  宋体12;  此字体下对应的点阵为:宽x高=16x16   --*#
#列表大小:10*16
F1=[0x80,0x70,0x00,0xFF,0x10,0x08,0x00,0x7E,0x2A,0xAA,0x2A,0x2A,0x2A,0x7E,0x00,0x00,0x80,0x60,0x18,0x07,0x08,0x50,0x42,0x4A,0x52,0x42,0x43,0x42,0x52,0x4A,0x42,0x00, #煜0x84,0x84,0xFC,0x84,0x84,0x00,0x04,0xC4,0x5F,0x44,0xF4,0x44,0x5F,0xC4,0x04,0x00,0x10,0x30,0x1F,0x08,0x08,0x00,0x84,0x47,0x24,0x14,0x0F,0x14,0x24,0x47,0x84,0x00, #瑛0x40,0x3C,0x10,0xFF,0x10,0x10,0x20,0x10,0x8F,0x78,0x08,0xF8,0x08,0xF8,0x00,0x00,0x02,0x06,0x02,0xFF,0x01,0x01,0x04,0x42,0x21,0x18,0x46,0x81,0x40,0x3F,0x00,0x00, #物0x02,0xFE,0x92,0x92,0xFE,0x02,0x00,0x10,0x11,0x16,0xF0,0x14,0x13,0x10,0x00,0x00, 0x10,0x1F,0x08,0x08,0xFF,0x04,0x81,0x41,0x31,0x0D,0x03,0x0D,0x31,0x41,0x81,0x00, #联0x00,0xFE,0x02,0x22,0x42,0x82,0x72,0x02,0x22,0x42,0x82,0x72,0x02,0xFE,0x00,0x00, 0x00,0xFF,0x10,0x08,0x06,0x01,0x0E,0x10,0x08,0x06,0x01,0x4E,0x80,0x7F,0x00,0x00, #网
]# 每个字符是8x16(宽x高) 点阵,
F2=[0x10,0xF0,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,    #*"h",0*#0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x19,0x24,0x24,0x12,0x3F,0x20,0x00,    #*"a",1*#0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x19,0x24,0x24,0x12,0x3F,0x20,0x00,     #*"a",2*#0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x33,0x24,0x24,0x24,0x24,0x19,0x00,     #*"s",3*#0x00,0xF8,0x88,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x20,0x20,0x20,0x11,0x0E,0x00,     #*"5",4*#0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,     #*"0",5*#0x00,0xE0,0x10,0x88,0x88,0x90,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x20,0x1F,0x00,     #*"6",6*#]#字符串 6x8点阵
F6x8=[[0x00, 0x00, 0x00, 0x00, 0x00, 0x00],# sp[0x00, 0x00, 0x00, 0x2f, 0x00, 0x00],# ![0x00, 0x00, 0x07, 0x00, 0x07, 0x00],# "[0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14],# #[0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12],# $[0x00, 0x62, 0x64, 0x08, 0x13, 0x23],# %[0x00, 0x36, 0x49, 0x55, 0x22, 0x50],# &[0x00, 0x00, 0x05, 0x03, 0x00, 0x00],# '[0x00, 0x00, 0x1c, 0x22, 0x41, 0x00],# ([0x00, 0x00, 0x41, 0x22, 0x1c, 0x00],# )[0x00, 0x14, 0x08, 0x3E, 0x08, 0x14],# *[0x00, 0x08, 0x08, 0x3E, 0x08, 0x08],# +[0x00, 0x00, 0x00, 0xA0, 0x60, 0x00],# ,[0x00, 0x08, 0x08, 0x08, 0x08, 0x08],# -[0x00, 0x00, 0x60, 0x60, 0x00, 0x00],# .[0x00, 0x20, 0x10, 0x08, 0x04, 0x02],# #[0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E],# 0[0x00, 0x00, 0x42, 0x7F, 0x40, 0x00],# 1[0x00, 0x42, 0x61, 0x51, 0x49, 0x46],# 2[0x00, 0x21, 0x41, 0x45, 0x4B, 0x31],# 3[0x00, 0x18, 0x14, 0x12, 0x7F, 0x10],# 4[0x00, 0x27, 0x45, 0x45, 0x45, 0x39],# 5[0x00, 0x3C, 0x4A, 0x49, 0x49, 0x30],# 6[0x00, 0x01, 0x71, 0x09, 0x05, 0x03],# 7[0x00, 0x36, 0x49, 0x49, 0x49, 0x36],# 8[0x00, 0x06, 0x49, 0x49, 0x29, 0x1E],# 9[0x00, 0x00, 0x36, 0x36, 0x00, 0x00],# :[0x00, 0x00, 0x56, 0x36, 0x00, 0x00],# ;[0x00, 0x08, 0x14, 0x22, 0x41, 0x00],# <[0x00, 0x14, 0x14, 0x14, 0x14, 0x14],# =[0x00, 0x00, 0x41, 0x22, 0x14, 0x08],# >[0x00, 0x02, 0x01, 0x51, 0x09, 0x06],# ?[0x00, 0x32, 0x49, 0x59, 0x51, 0x3E],# @[0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C],# A[0x00, 0x7F, 0x49, 0x49, 0x49, 0x36],# B[0x00, 0x3E, 0x41, 0x41, 0x41, 0x22],# C[0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C],# D[0x00, 0x7F, 0x49, 0x49, 0x49, 0x41],# E[0x00, 0x7F, 0x09, 0x09, 0x09, 0x01],# F[0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A],# G[0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F],# H[0x00, 0x00, 0x41, 0x7F, 0x41, 0x00],# I[0x00, 0x20, 0x40, 0x41, 0x3F, 0x01],# J[0x00, 0x7F, 0x08, 0x14, 0x22, 0x41],# K[0x00, 0x7F, 0x40, 0x40, 0x40, 0x40],# L[0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F],# M[0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F],# N[0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E],# O[0x00, 0x7F, 0x09, 0x09, 0x09, 0x06],# P[0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E],# Q[0x00, 0x7F, 0x09, 0x19, 0x29, 0x46],# R[0x00, 0x46, 0x49, 0x49, 0x49, 0x31],# S[0x00, 0x01, 0x01, 0x7F, 0x01, 0x01],# T[0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F],# U[0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F],# V[0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F],# W[0x00, 0x63, 0x14, 0x08, 0x14, 0x63],# X[0x00, 0x07, 0x08, 0x70, 0x08, 0x07],# Y[0x00, 0x61, 0x51, 0x49, 0x45, 0x43],# Z[0x00, 0x00, 0x7F, 0x41, 0x41, 0x00],# [[0x00, 0x55, 0x2A, 0x55, 0x2A, 0x55],# 55[0x00, 0x00, 0x41, 0x41, 0x7F, 0x00],# ][0x00, 0x04, 0x02, 0x01, 0x02, 0x04],# ^[0x00, 0x40, 0x40, 0x40, 0x40, 0x40],# _[0x00, 0x00, 0x01, 0x02, 0x04, 0x00],# '[0x00, 0x20, 0x54, 0x54, 0x54, 0x78],# a[0x00, 0x7F, 0x48, 0x44, 0x44, 0x38],# b[0x00, 0x38, 0x44, 0x44, 0x44, 0x20],# c[0x00, 0x38, 0x44, 0x44, 0x48, 0x7F],# d[0x00, 0x38, 0x54, 0x54, 0x54, 0x18],# e[0x00, 0x08, 0x7E, 0x09, 0x01, 0x02],# f[0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C],# g[0x00, 0x7F, 0x08, 0x04, 0x04, 0x78],# h[0x00, 0x00, 0x44, 0x7D, 0x40, 0x00],# i[0x00, 0x40, 0x80, 0x84, 0x7D, 0x00],# j[0x00, 0x7F, 0x10, 0x28, 0x44, 0x00],# k[0x00, 0x00, 0x41, 0x7F, 0x40, 0x00],# l[0x00, 0x7C, 0x04, 0x18, 0x04, 0x78],# m[0x00, 0x7C, 0x08, 0x04, 0x04, 0x78],# n[0x00, 0x38, 0x44, 0x44, 0x44, 0x38],# o[0x00, 0xFC, 0x24, 0x24, 0x24, 0x18],# p[0x00, 0x18, 0x24, 0x24, 0x18, 0xFC],# q[0x00, 0x7C, 0x08, 0x04, 0x04, 0x08],# r[0x00, 0x48, 0x54, 0x54, 0x54, 0x20],# s[0x00, 0x04, 0x3F, 0x44, 0x40, 0x20],# t[0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C],# u[0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C],# v[0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C],# w[0x00, 0x44, 0x28, 0x10, 0x28, 0x44],# x[0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C],# y[0x00, 0x44, 0x64, 0x54, 0x4C, 0x44],# z[0x14, 0x14, 0x14, 0x14, 0x14, 0x14]# horiz lines
]#字符串 8x16点阵
F8X16=[0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,# 00x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x30,0x00,0x00,0x00,#! 10x00,0x10,0x0C,0x06,0x10,0x0C,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,#" 20x40,0xC0,0x78,0x40,0xC0,0x78,0x40,0x00,0x04,0x3F,0x04,0x04,0x3F,0x04,0x04,0x00,## 30x00,0x70,0x88,0xFC,0x08,0x30,0x00,0x00,0x00,0x18,0x20,0xFF,0x21,0x1E,0x00,0x00,#$ 40xF0,0x08,0xF0,0x00,0xE0,0x18,0x00,0x00,0x00,0x21,0x1C,0x03,0x1E,0x21,0x1E,0x00,#% 50x00,0xF0,0x08,0x88,0x70,0x00,0x00,0x00,0x1E,0x21,0x23,0x24,0x19,0x27,0x21,0x10,#& 60x10,0x16,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,#' 70x00,0x00,0x00,0xE0,0x18,0x04,0x02,0x00,0x00,0x00,0x00,0x07,0x18,0x20,0x40,0x00,#( 80x00,0x02,0x04,0x18,0xE0,0x00,0x00,0x00,0x00,0x40,0x20,0x18,0x07,0x00,0x00,0x00,#) 90x40,0x40,0x80,0xF0,0x80,0x40,0x40,0x00,0x02,0x02,0x01,0x0F,0x01,0x02,0x02,0x00,#* 100x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x1F,0x01,0x01,0x01,0x00,#+ 110x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xB0,0x70,0x00,0x00,0x00,0x00,0x00,#, 120x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,#- 130x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,#. 140x00,0x00,0x00,0x00,0x80,0x60,0x18,0x04,0x00,0x60,0x18,0x06,0x01,0x00,0x00,0x00,## 150x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,#0 160x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,#1 170x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,#2 180x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00,#3 190x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00,#4 200x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00,#5 210x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00,#6 220x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,#7 230x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00,#8 240x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00,#9 250x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,#: 260x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x00,0x00,0x00,0x00,#; 270x00,0x00,0x80,0x40,0x20,0x10,0x08,0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x20,0x00,#< 280x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x00,#= 290x00,0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x00,0x20,0x10,0x08,0x04,0x02,0x01,0x00,#> 300x00,0x70,0x48,0x08,0x08,0x08,0xF0,0x00,0x00,0x00,0x00,0x30,0x36,0x01,0x00,0x00,#? 310xC0,0x30,0xC8,0x28,0xE8,0x10,0xE0,0x00,0x07,0x18,0x27,0x24,0x23,0x14,0x0B,0x00,#@ 320x00,0x00,0xC0,0x38,0xE0,0x00,0x00,0x00,0x20,0x3C,0x23,0x02,0x02,0x27,0x38,0x20,#A 330x08,0xF8,0x88,0x88,0x88,0x70,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x11,0x0E,0x00,#B 340xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00,#C 350x08,0xF8,0x08,0x08,0x08,0x10,0xE0,0x00,0x20,0x3F,0x20,0x20,0x20,0x10,0x0F,0x00,#D 360x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x20,0x23,0x20,0x18,0x00,#E 370x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x00,0x03,0x00,0x00,0x00,#F 380xC0,0x30,0x08,0x08,0x08,0x38,0x00,0x00,0x07,0x18,0x20,0x20,0x22,0x1E,0x02,0x00,#G 390x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x20,0x3F,0x21,0x01,0x01,0x21,0x3F,0x20,#H 400x00,0x08,0x08,0xF8,0x08,0x08,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,#I 410x00,0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,0x00,#J 420x08,0xF8,0x88,0xC0,0x28,0x18,0x08,0x00,0x20,0x3F,0x20,0x01,0x26,0x38,0x20,0x00,#K 430x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x00,#L 440x08,0xF8,0xF8,0x00,0xF8,0xF8,0x08,0x00,0x20,0x3F,0x00,0x3F,0x00,0x3F,0x20,0x00,#M 450x08,0xF8,0x30,0xC0,0x00,0x08,0xF8,0x08,0x20,0x3F,0x20,0x00,0x07,0x18,0x3F,0x00,#N 460xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00,#O 470x08,0xF8,0x08,0x08,0x08,0x08,0xF0,0x00,0x20,0x3F,0x21,0x01,0x01,0x01,0x00,0x00,#P 480xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x18,0x24,0x24,0x38,0x50,0x4F,0x00,#Q 490x08,0xF8,0x88,0x88,0x88,0x88,0x70,0x00,0x20,0x3F,0x20,0x00,0x03,0x0C,0x30,0x20,#R 500x00,0x70,0x88,0x08,0x08,0x08,0x38,0x00,0x00,0x38,0x20,0x21,0x21,0x22,0x1C,0x00,#S 510x18,0x08,0x08,0xF8,0x08,0x08,0x18,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,#T 520x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,#U 530x08,0x78,0x88,0x00,0x00,0xC8,0x38,0x08,0x00,0x00,0x07,0x38,0x0E,0x01,0x00,0x00,#V 540xF8,0x08,0x00,0xF8,0x00,0x08,0xF8,0x00,0x03,0x3C,0x07,0x00,0x07,0x3C,0x03,0x00,#W 550x08,0x18,0x68,0x80,0x80,0x68,0x18,0x08,0x20,0x30,0x2C,0x03,0x03,0x2C,0x30,0x20,#X 560x08,0x38,0xC8,0x00,0xC8,0x38,0x08,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,#Y 570x10,0x08,0x08,0x08,0xC8,0x38,0x08,0x00,0x20,0x38,0x26,0x21,0x20,0x20,0x18,0x00,#Z 580x00,0x00,0x00,0xFE,0x02,0x02,0x02,0x00,0x00,0x00,0x00,0x7F,0x40,0x40,0x40,0x00,#[ 590x00,0x0C,0x30,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x06,0x38,0xC0,0x00,#\ 600x00,0x02,0x02,0x02,0xFE,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x7F,0x00,0x00,0x00,#] 610x00,0x00,0x04,0x02,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,#^ 620x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,#_ 630x00,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,#` 640x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20,#a 650x08,0xF8,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x3F,0x11,0x20,0x20,0x11,0x0E,0x00,#b 660x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x0E,0x11,0x20,0x20,0x20,0x11,0x00,#c 670x00,0x00,0x00,0x80,0x80,0x88,0xF8,0x00,0x00,0x0E,0x11,0x20,0x20,0x10,0x3F,0x20,#d 680x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x22,0x22,0x22,0x22,0x13,0x00,#e 690x00,0x80,0x80,0xF0,0x88,0x88,0x88,0x18,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,#f 700x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x6B,0x94,0x94,0x94,0x93,0x60,0x00,#g 710x08,0xF8,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,#h 720x00,0x80,0x98,0x98,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,#i 730x00,0x00,0x00,0x80,0x98,0x98,0x00,0x00,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,#j 740x08,0xF8,0x00,0x00,0x80,0x80,0x80,0x00,0x20,0x3F,0x24,0x02,0x2D,0x30,0x20,0x00,#k 750x00,0x08,0x08,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,#l 760x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F,#m 770x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,#n 780x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,#o 790x80,0x80,0x00,0x80,0x80,0x00,0x00,0x00,0x80,0xFF,0xA1,0x20,0x20,0x11,0x0E,0x00,#p 800x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x0E,0x11,0x20,0x20,0xA0,0xFF,0x80,#q 810x80,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x20,0x20,0x3F,0x21,0x20,0x00,0x01,0x00,#r 820x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x33,0x24,0x24,0x24,0x24,0x19,0x00,#s 830x00,0x80,0x80,0xE0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x20,0x00,0x00,#t 840x80,0x80,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x1F,0x20,0x20,0x20,0x10,0x3F,0x20,#u 850x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x00,0x01,0x0E,0x30,0x08,0x06,0x01,0x00,#v 860x80,0x80,0x00,0x80,0x00,0x80,0x80,0x80,0x0F,0x30,0x0C,0x03,0x0C,0x30,0x0F,0x00,#w 870x00,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x31,0x2E,0x0E,0x31,0x20,0x00,#x 880x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x80,0x81,0x8E,0x70,0x18,0x06,0x01,0x00,#y 890x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x21,0x30,0x2C,0x22,0x21,0x30,0x00,#z 900x00,0x00,0x00,0x00,0x80,0x7C,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x3F,0x40,0x40,# 910x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,#| 920x00,0x02,0x02,0x7C,0x80,0x00,0x00,0x00,0x00,0x40,0x40,0x3F,0x00,0x00,0x00,0x00,# 930x00,0x06,0x01,0x01,0x02,0x02,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,#~ 94
]BMP1=[0x00,0x03,0x05,0x09,0x11,0xFF,0x11,0x89,0x05,0xC3,0x00,0xE0,0x00,0xF0,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x28,0xFF,0x11,0xAA,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83,0x01,0x38,0x44,0x82,0x92,0x92,0x74,0x01,0x83,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0x44,0xC7,0x01,0x7D,0x7D,0x7D,0x7D,0x01,0x7D,0x7D,0x7D,0x7D,0x01,0x7D,0x7D,0x7D,0x7D,0x01,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x6D,0x6D,0x6D,0x6D,0x6D,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDB,0xDB,0xDB,0xDB,0xDB,0x00,0x00,0xDB,0xDB,0xDB,0xDB,0xDB,0x00,0x00,0xDB,0xDB,0xDB,0xDB,0xDB,0x00,0x00,0xDB,0xDB,0xDB,0xDB,0xDB,0x00,0x00,0xDA,0xDA,0xDA,0xDA,0xDA,0x00,0x00,0xD8,0xD8,0xD8,0xD8,0xD8,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x06,0x06,0x06,0xE6,0x66,0x20,0x00,0x06,0x06,0x86,0x06,0x06,0x00,0x00,0x06,0x06,0x06,0x06,0x86,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x86,0x86,0x86,0x86,0x86,0x80,0x80,0x86,0x86,0x06,0x86,0x86,0xC0,0xC0,0x86,0x86,0x86,0x06,0x06,0xD0,0x30,0x76,0x06,0x06,0x06,0x06,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x1C,0x00,0xFE,0x00,0x01,0x02,0x00,0xC4,0x18,0x20,0x02,0x9E,0x63,0xB2,0x0E,0x00,0xFF,0x81,0x81,0xFF,0x00,0x00,0x80,0x40,0x30,0x0F,0x00,0x00,0x00,0x00,0xFF,0x00,0x23,0xEA,0xAA,0xBF,0xAA,0xEA,0x03,0x3F,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x0C,0x08,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x81,0x80,0x80,0x81,0x80,0x81,0x80,0x80,0x80,0x80,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x01,0x09,0x0C,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x1E,0x21,0x40,0x40,0x50,0x21,0x5E,0x00,0x1E,0x21,0x40,0x40,0x50,0x21,0x5E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xC1,0xC1,0xFF,0xFF,0xC1,0xC1,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x80,0xFC,0xF3,0xEF,0xF3,0xFC,0x80,0xFF,0x80,0xEE,0xEE,0xEE,0xF5,0xFB,0xFF,0x9C,0xBE,0xB6,0xB6,0x88,0xFF,0x00]#像素:64*64
#列表大小:32*16
BMP2=[0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x60,0x38,0x08,0x0C,0x06,0xC2,0xE2,0x33,0x11,0xF9,0x11,0x33,0x73,0xE2,0x06,0x04,0x0C,0x18,0x30,0xE0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xF7,0x00,0x00,0x00,0x00,0x00,0xC3,0x87,0x06,0x0C,0xFF,0x0C,0x18,0x18,0xF0,0xE0,0x00,0x00,0x00,0x00,0x81,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x07,0x0C,0x18,0x30,0x30,0x61,0x63,0x46,0x46,0x5F,0x46,0x46,0x43,0x63,0x20,0x30,0x18,0x0C,0x06,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xE0,0xE0,0xF0,0xE0,0xE0,0xC0,0x60,0x70,0x30,0x38,0x18,0x18,0x0C,0x0C,0x0C,0x66,0x66,0x66,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x66,0x66,0x0C,0x0C,0x0C,0x18,0x18,0x30,0x30,0x60,0xE0,0xE0,0x70,0x38,0x18,0x0C,0xFC,0xFC,0x1C,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC7,0xFF,0x79,0x1B,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0xC3,0xC7,0x06,0x0C,0x18,0x70,0xE0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x03,0x03,0x03,0x83,0xFF,0x7F,0x00,0x00,0x00,0x00,0x00,0x03,0x07,0xFE,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0xC0,0xC0,0xC0,0x60,0x60,0x30,0x30,0x18,0x1C,0x0E,0x06,0x03,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x3F,0x78,0xE0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xFE,0xFE,0x06,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x1C,0x38,0xF0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xDC,0xFF,0xC3,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
]#32-32.bmp
BMP3=[0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x0E,0x02,0x9B,0xBD,0xFF,0x65,0xED,0xCB,0x06,0x9C,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0x60,0x61,0x23,0xF6,0xFD,0x7F,0x7F,0x7B,0x7D,0xF4,0xF6,0x23,0x60,0x60,0xC0,0xC0,0x60,0x60,0xE0,0x60,0x20,0x00,0x00,0x00,0x00,0x00,0x20,0xFF,0x8F,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x1B,0x06,0x0C,0x18,0x90,0xF0,0x20,0x00,0x01,0x1F,0x7E,0xE0,0x80,0x80,0xA0,0xF0,0x30,0x20,0x20,0x20,0x20,0x20,0x20,0x60,0xC0,0x80,0x80,0xF0,0xF0,0x18,0x18,0x08,0x0C,0x04,0x06,0x03,0x01,0x01,0x00,
]

board.json

  • 使用485读取log
{"version": "2.0.0","io": {"OLED": {"type": "I2C","port": 1,"addrWidth": 7,"freq": 400000,"mode": "master","devAddr": 60},   "serial1":{"type":"UART","port":0,"dataWidth":8,"baudRate":9600,"stopBits":1,"flowControl":"disable","parity":"none"},"KEY1": {"type": "GPIO","port": 44,"dir": "irq","pull": "pullup","intMode": "rising"}},"debugLevel": "ERROR","repl": "enable","replPort": 2}

应用开发

以下是物联网应用开发流程,接下来按以下流程介绍移动端应用的开发。

3.1新建‘普通项目’

  • 使用阿里云IoTStudio创建项目。
  • 在项目管理新建空白项目
    在这里插入图片描述
    在这里插入图片描述

3.2关联产品和设备

在这里插入图片描述
在这里插入图片描述

3.3新建‘移动应用’

在这里插入图片描述
在这里插入图片描述

3.4添加组件

在这里插入图片描述

3.5配置组件信息

物体重量
在这里插入图片描述
在这里插入图片描述
单位"克"
在这里插入图片描述
系数k,最大值改2000
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

去皮
在这里插入图片描述
在这里插入图片描述
称重
在这里插入图片描述
在这里插入图片描述
再添加两个按钮用来切换模式
在这里插入图片描述
在这里插入图片描述

3.6保存预览

在这里插入图片描述
手机扫码就可以使用了
在这里插入图片描述

相关文章:

5.35 综合案例2.0 -称重数据上传云端

综合案例2.0 - 称重数据上传云端案例说明连线功能实现1.阿里云平台连接代码应用开发3.1新建‘普通项目’3.2关联产品和设备3.3新建‘移动应用’3.4添加组件3.5配置组件信息3.6保存预览案例说明 使用hx711串口模块称重,结合IOT studio制作手机APP远程控制并采集物体重量。 hx7…...

如何让人机对话更自然?

来源&#xff1a;投稿 作者&#xff1a;顾相欢 编辑&#xff1a;学姐 AAAI-2022|定制对话的人设和知识背景 原文标题&#xff1a; Call for Customized Conversation: Customized Conversation Grounding Persona and Knowledge 原文链接&#xff1a; https://arxiv.org/ab…...

Python每日一练(20230224)

目录 1. 列表奇偶拆分 ★ 2. 二叉树的后序遍历 ★★ 3. 接雨水 ★★★ 附录 二叉树 特点 性质 特殊二叉树 满二叉树 完全二叉树 完全二叉树性质 二叉树的遍历 1. 列表奇偶拆分 【问题描述】 输入一个列表&#xff0c;包含若干个整数&#xff08;允许为空&#xff…...

【Linux】-- Shell的运行原理、Linux当中的权限

目录 Shell的运行原理 Linux权限的概念 su命令 权限 文件访问权限的相关设置方法 chmod指令 chown指令 chgrp指令 sudo命令 文件的常见问题 umask 粘滞位 关于权限的总结 Shell的运行原理 Shell运行原理 —— 外壳程序。 Linux严格意义上说的是一个操作系统&…...

MOS管选型参数:VGS(th)

MOS管选型参数&#xff1a;VGS(th) VGS&#xff08;th&#xff09;&#xff1a;开启电压&#xff08;阀值电压&#xff09;。当外加栅极控制电压 VGS 超过 VGS&#xff08;th&#xff09; 时&#xff0c;漏区和源区的表面反型层形成了连接的沟道。应用中&#xff0c;常将漏极短…...

二.线性表之顺序表

文章目录前言一.顺序表的概念及结构二.顺序表的接口实现1.顺序表的动态存储2.顺序表的初始化3.顺序表尾插#封装&#xff1a;扩容函数4.顺序表尾删5.顺序表头插6.顺序表头删7.顺序表查找8.顺序表在pos位置插入x9.顺序表删除pos位置的值10.顺序表销毁11.顺序表打印三.源1.Seqlist…...

ElasticSearch - SpringBoot整合ElasticSearch实现文档的增删改

文章目录1. ElasticSearch和kibana的安装和配置2. SpringBoot 项目环境搭建3. 创建索引4. 索引文档5. 更新文档6. 删除文档https://www.elastic.co/guide/en/elasticsearch/reference/current/search-your-data.htmlhttps://www.elastic.co/guide/cn/elasticsearch/guide/curre…...

JavaScript 库

文章目录JavaScript 库JavaScript 框架&#xff08;库&#xff09;jQueryPrototypeMooTools其他框架CDN -内容分发网络引用 jQuery使用框架JavaScript 库 JavaScript 库 - jQuery、Prototype、MooTools。 JavaScript 框架&#xff08;库&#xff09; JavaScript 高级程序设计…...

云解析DNS为什么要配置默认线路?

传统解析技术不会判断访客IP&#xff0c;而是会随机选择一个IP返回给访问者&#xff0c;这样就有可能造成移动用户访问电信服务器IP&#xff0c;北京用户访问深圳服务器IP这种跨域跨网访问的情况&#xff0c;产生非常大的延迟&#xff0c;带来很不好的访问体验。 而云解析DNS会…...

Linux命令之awk

awk是一个有强大的文本格式化能力的linux命令&#xff0c;早期是在Unix上实现的&#xff0c;linux后来也可以使用了&#xff0c;我们在Linux上使用的awk是gawk&#xff08;GNU awk的意思&#xff09; 语法 awk [option] 模式{动作} file option表示awk的可选参数&#xff0c;可…...

实战-缓存数据一致+binlog初始+cannel监听+数据迁移,数据一致性架构设计

前言 一. 解决缓存不命中&#xff08;高并发操作击穿打挂DB的风险&#xff09; 当并发量打的时候&#xff0c;当我们的缓存过期时&#xff0c;就算到数据库的比例偏小的时候&#xff0c;我们的请求时比较大的。那也会存在数据库崩掉的情况。解决方案想法如下&#xff08;总体…...

nginx配置中proxy_pass反向代理502的bug

记录一个坑人的bug&#xff0c; 我今天在一台新的liunx上运行nginx来进行反向代理时候&#xff0c;发现怎么测都是502 我把配置全部删了从头开始配置&#xff0c;发现80端口正常&#xff0c;80端口index.html正常&#xff0c;反向代理转向http://127.0.0.1/也正常&#xff0c;…...

JavaScript 两种方案打开文件对话框

JavaScript 两种方案打开文件对话框 文章目录JavaScript 两种方案打开文件对话框一、文件对话框二、传统方案表单元素&#x1f308;三、文件系统访问API&#x1f4a6;四、更进一步使用六、代码仓库&#x1f310;七、参考资料&#x1f498;七、推荐博文&#x1f357;一、文件对话…...

Pycharm远程服务器常见问题

2023年02月23日 问题描述&#xff1a;Pycharm远程服务器跑代码时&#xff0c;不小心把Pycharm关掉了&#xff0c;但服务器代码还在运行&#xff1f; 解决办法&#xff1a;kill进程 先用watch -n 0.5 nvidia_smi查看进程&#xff0c;然后kill -9 <进程> 1、nvidia-smi…...

内容团队如何快速出稿

对于内容团队而言&#xff0c;每个内容选题就相当于一个小项目&#xff0c;它们并非简单的线性工作流&#xff0c;相反其复杂程度不亚于一个小型工厂。一个内容选题会涉及内容形式&#xff0c;选题类型等多个变量&#xff0c;这些变量因素组合起来就是十几种不同类型的工作流。…...

es-08索引的批量操作

索引的批量操作 批量查询和批量增删改 批量查询 GET /_mget#批量查询 GET product/_search GET /_mget {"docs": [{"_index": "product","_id": 2},{"_index": "product","_id": 3}] }GET product/_mge…...

诈金花的概率

游戏使用一副除去大小王的扑克牌&#xff0c;共4个花色52张牌。 1、豹子&#xff08;AAA最大&#xff0c;222最小&#xff09;。2、同花顺&#xff08;AKQ最大&#xff0c;A23最小&#xff09;。3、同花&#xff08;AKQ最大&#xff0c;352最小&#xff09;。4、顺子&#xff…...

ESP32设备驱动-MLX90393磁场传感器驱动

MLX90393磁场传感器驱动 文章目录 MLX90393磁场传感器驱动1、MLX90393介绍2、硬件准备3、软件准备4、驱动实现1、MLX90393介绍 MLX90393 磁场传感器可以在运行时重新编程为不同的模式和不同的设置。 该传感器使用 Melexis 专有的 Triaxis 技术提供与沿 XYZ 轴感应的磁通密度成…...

Java面试题-Spring框架

Spring框架 1. BeanFactory和ApplicationContext有何区别 BeanFactory是Spring最底层的接口&#xff0c;是IoC的核心&#xff0c;定义IoC的基本功能。 ​ BeanFactory具有&#xff1a;延迟实例化的特性。在启动的时候&#xff0c;不会实例化Bean&#xff0c;只有有需要从容器…...

【计算机物理模拟】-力矩、转动惯量和角速度之间的关系

力矩和角速度之间的关系可以通过牛顿第二定律和角动量定理来描述。 牛顿第二定律表明&#xff0c;物体的加速度与作用在物体上的合力成正比&#xff0c;加速度的方向与合力的方向相同。而对于旋转运动的物体&#xff0c;其加速度可以表示为半径 rrr 乘以角加速度 α\alphaα&a…...

OpenClaw对话式编程:Qwen3-4B模型解释代码与生成示例

OpenClaw对话式编程&#xff1a;Qwen3-4B模型解释代码与生成示例 1. 为什么需要对话式编程&#xff1f; 作为一名长期与代码打交道的开发者&#xff0c;我经常遇到这样的困境&#xff1a;面对一段复杂代码时&#xff0c;需要反复查阅文档&#xff1b;学习新框架时&#xff0c…...

Python入门第6章:字典(键值对数据结构)

Python入门第6章&#xff1a;字典&#xff08;键值对数据结构&#xff09; 大家好&#xff0c;欢迎来到Python入门系列的第6章内容&#xff01;在前5章里&#xff0c;我们学会了变量、数据类型、运算符、if语句等基础知识点&#xff0c;也接触了列表、元组这两种序列数据结构—…...

UCI心脏病数据集实战:用XGBoost构建预测模型的全流程指南(附特征重要性分析)

UCI心脏病数据集实战&#xff1a;用XGBoost构建预测模型的全流程指南&#xff08;附特征重要性分析&#xff09; 医疗数据科学正在重塑现代医学诊断方式。当我在克利夫兰诊所实习期间&#xff0c;亲眼见证了机器学习模型如何辅助医生识别高风险心脏病患者。本文将带您完整复现这…...

Qwen-Edit-2509多角度切换技术:如何用单张图片生成全视角内容?

Qwen-Edit-2509多角度切换技术&#xff1a;如何用单张图片生成全视角内容&#xff1f; 【免费下载链接】Qwen-Edit-2509-Multiple-angles 项目地址: https://ai.gitcode.com/hf_mirrors/dx8152/Qwen-Edit-2509-Multiple-angles 在视觉创作领域&#xff0c;你是否曾为拍…...

如何突破Cursor AI使用限制?解锁永久免费Pro功能的终极指南

如何突破Cursor AI使用限制&#xff1f;解锁永久免费Pro功能的终极指南 【免费下载链接】cursor-free-vip [Support 0.45]&#xff08;Multi Language 多语言&#xff09;自动注册 Cursor Ai &#xff0c;自动重置机器ID &#xff0c; 免费升级使用Pro 功能: Youve reached you…...

L1-064 估值一亿的ai核心代码 (分数20)字符串处理

•无论用户说什么&#xff0c;首先把对方说的话在一行中原样打印出来&#xff1b;•消除原文中多余空格&#xff1a;把相邻单词间的多个空格换成 1 个空格&#xff0c;把行首尾的空格全部删掉&#xff0c;把标点符号前面的空格删掉&#xff1b; •把原文中所有大写英文字母变成…...

马年市场快报分析:欧美组合式一氧化碳及可燃气体报警器指南

马年市场快报分析&#xff1a;欧美组合式一氧化碳及可燃气体报警器指南根据您提供的快报内容&#xff0c;我将从专业角度逐步分析欧美组合式一氧化碳&#xff08;CO&#xff09;及可燃气体报警器的关键信息&#xff0c;包括安全标准、风险因素、探测器区别、安装建议以及相关产…...

3步掌握百度网盘效率工具:全平台秒传链接解决方案

3步掌握百度网盘效率工具&#xff1a;全平台秒传链接解决方案 【免费下载链接】baidupan-rapidupload 百度网盘秒传链接转存/生成/转换 网页工具 (全平台可用) 项目地址: https://gitcode.com/gh_mirrors/bai/baidupan-rapidupload 在数字化协作时代&#xff0c;文件传输…...

comsol电磁超声压电接收EMAT 在1mm厚铝板中激励250kHz的电磁超声在200mm位...

comsol电磁超声压电接收EMAT 在1mm厚铝板中激励250kHz的电磁超声在200mm位置处设置一个深0.8mm的裂纹缺陷&#xff0c;左端面设为低反射边界 在85mm位置处放置一个压电片接收信号&#xff0c;信号如图3所示&#xff0c;三个波分别为始波&#xff0c;裂纹反射波(S0模态)和右端面…...

【个人推荐】一些好用的录音转写工具

因为助教课备课的缘故&#xff0c;需要录制讲座的音频以整理知识点。一次讲座的音频内容很长&#xff0c;即使3x速快进播放依然很耗费时间&#xff0c;因此录音转写的需求浮现了出来。于是闲暇之余探索了下市面上的录音转写工具&#xff0c;浅浅记录下体验。 下面主要推荐三款…...