【雕爷学编程】MicroPython动手做(16)——掌控板之图片图像显示2

news2024/11/17 16:24:28

知识点:什么是掌控板?
掌控板是一块普及STEAM创客教育、人工智能教育、机器人编程教育的开源智能硬件。它集成ESP-32高性能双核芯片,支持WiFi和蓝牙双模通信,可作为物联网节点,实现物联网应用。同时掌控板上集成了OLED显示屏、RGB灯、加速度计、麦克风、光线传感器、蜂鸣器、按键开关、触摸开关、金手指外部拓展接口,支持图形化及MicroPython代码编程,可实现智能机器人、创客智造作品等智能控制类应用。

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

掌控板硬件特性:
ESP-32主控
处理器:Tensilica LX6双核处理器(一核处理高速连接;一核独立应用开发)
主频:高达240MHz的时钟频率
SRAM:520KB
Flash:8MB
Wi-Fi标准:FCC/CE/TELEC/KCC
Wi-Fi协议:802.11 b/g/n/d/e/i/k/r (802.11n,速度高达150 Mbps),A-MPDU和A-MSDU聚合,支持0.4us防护间隔
频率范围:2.4~2.5 GHz
蓝牙协议:符合蓝牙v4.2 BR/EDR和BLE标准
蓝牙音频:CVSD和SBC音频低功耗:10uA
供电方式:Micro USB供电
工作电压:3.3V
最大工作电流:200mA
最大负载电流:1000mA
掌控板载
三轴加速度计MSA300,测量范围:±2/4/8/16G
地磁传感器MMC5983MA,测量范围:±8 Gauss;精度0.4mGz,电子罗盘误差±0.5°
光线传感器
麦克风
3 颗全彩ws2812灯珠
1.3英寸OLED显示屏,支持16*16字符显示,分辨率128x64
无源蜂鸣器
支持2个物理按键(A/B)、6个触摸按键
支持1路鳄鱼夹接口,可方便接入各种阻性传感器
拓展接口
20通道数字I/O, (其中支持12路PWM,6路触摸输入)
5通道12bit模拟输入ADC,P0~P4
1路的外部输入鳄鱼夹接口:EXT/GND
支持I2C、UART、SPI通讯协议

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

4、OLED显示外部图片
OLED屏幕只能显示颜色深度为1或者就是黑白模式的bmp格式,可以使用Photoshop、“画图”或者其他图片显示软件进行转换。转换好格式的图片需要使用取模工具对图片进行取模,转换的图片大小应该为128*64,也就是掌控板屏幕的大小。所选的图片线条要分明,且颜色不能太过丰富。
(1)选择一张图片

在这里插入图片描述
用在线PS打开图片,这里使用 https://www.uupoop.com/

在这里插入图片描述
(3)调整为128*64规格,另存为bmp格式
在这里插入图片描述

(4)安装小图片取模工具Image2Lcd
下载地址:
http://7dx.0098118.com/wwb5/image2lcd32.zip

在这里插入图片描述
(5)去头去尾要中间(取模数据)

在这里插入图片描述

(6)将复制的16进制图像数据粘贴在下列指令的空格处。

描述:OLED绘制16进制数组图像。将16进制数据转换成图像显示在oled屏幕的指定位置处。尝试将程序搭建好,将图片显示出来。

mPython 图形编程
在这里插入图片描述

#MicroPython动手做(16)——掌控板之图片图像显示
#OLED显示外部图片

from mpython import *

import time
while True:
    oled.fill(0)
    oled.Bitmap(0, 0, bytearray([0XFF,0XFF,0XFF,0XFF,0X00,0X0F,0XFF,0XFF,0XFF,0XFF,0XF0,0X00,0XFF,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0X00,0X1F,0XFF,0XFF,0XFF,0XFF,0XF0,0X00,0XFF,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0X00,0X3C,0X00,0X00,0X00,0X00,0X70,0X00,0XFF,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0X00,0X7C,0X00,0X00,0X00,0X00,0X70,0X00,0XFF,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0X00,0XEC,0X03,0XFF,0XFF,0XFF,0XFF,0XFC,0XFF,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0X01,0XCC,0X07,0XFF,0XFF,0XFF,0XFF,0XFE,0XFF,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0X03,0X8C,0X06,0X00,0X00,0X00,0X00,0X03,0XFF,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0X07,0X0C,0X06,0X00,0X00,0X00,0X00,0X03,0XFF,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XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF0,0X00,0XFF,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XF0,0X00,0XFF,0XFF,0XFF,0XFF,]), 128, 64, 1)
    oled.show()
    time.sleep(1)
    oled.fill(0)
    oled.Bitmap(0, 0, bytearray([0X00,0X00,0X00,0X00,0XFF,0XF0,0X00,0X00,0X00,0X00,0X0F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0XFF,0XE0,0X00,0X00,0X00,0X00,0X0F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0XFF,0XC3,0XFF,0XFF,0XFF,0XFF,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0XFF,0X83,0XFF,0XFF,0XFF,0XFF,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0XFF,0X13,0XFC,0X00,0X00,0X00,0X00,0X03,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0XFE,0X33,0XF8,0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0XFC,0X73,0XF9,0XFF,0XFF,0XFF,0XFF,0XFC,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0XF8,0XF3,0XF9,0XFF,0XFF,0XFF,0XFF,0XFC,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0XF1,0XF3,0XF9,0X80,0X78,0XF9,0XC0,0X3C,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0XE3,0XF3,0XF9,0X80,0X38,0X71,0X80,0X1C,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0XC7,0XF3,0XF9,0X9F,0X18,0X61,0X8F,0X8C,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X8F,0XF3,0XF9,0X9F,0X98,0X01,0X8F,0XCC,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X00,0X03,0XF9,0X9F,0X99,0X09,0X8F,0XCC,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X00,0X03,0XF9,0X80,0X19,0X99,0X80,0X1C,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X3F,0XFF,0XF9,0X80,0X39,0XD9,0X80,0X1C,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X3F,0XFF,0XF9,0X9F,0X19,0XF9,0X8F,0XFC,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XBF,0XF9,0X9F,0X99,0XF9,0X8F,0XFC,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0X3F,0XF9,0X9F,0X99,0XF9,0X8F,0XFC,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X3B,0XBF,0XF9,0X80,0X19,0XF9,0X8F,0XFC,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X3F,0XFF,0XF9,0X80,0X39,0XF9,0X8F,0XFC,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X3F,0XFF,0XF9,0X80,0XF9,0XFD,0XDF,0XFC,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFF,0XF9,0XFF,0XFF,0XFF,0XFF,0XFC,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFF,0XF9,0XFF,0XFF,0XFF,0XFF,0XF8,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X3F,0XFF,0XF8,0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X3F,0XFF,0XFE,0X00,0X00,0X00,0X00,0X03,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X3F,0XFF,0XFF,0XFF,0XFF,0XFF,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X3F,0XFF,0XFF,0XFF,0XFF,0XFF,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X30,0X00,0X00,0X00,0X00,0X01,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X30,0X00,0X00,0X00,0X00,0X01,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFF,0XFF,0XFF,0XFF,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFF,0XFC,0X07,0XFF,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFF,0XF8,0X01,0XFF,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFF,0XE1,0XF8,0XFF,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFF,0XC7,0XFC,0X7F,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFF,0XCF,0XFE,0X3F,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFF,0X8F,0XFF,0X3F,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFF,0X9F,0XFF,0X1F,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFF,0X9F,0XFF,0X9F,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFF,0X1F,0XFF,0X9F,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFF,0X1F,0XFF,0X9F,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFF,0X9F,0XFF,0X9F,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFF,0X9F,0XFF,0X9F,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFF,0X9F,0XFF,0X3F,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFF,0XCF,0XFE,0X3F,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFF,0XC7,0XFE,0X7F,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFF,0XE3,0XF8,0X7F,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFF,0X80,0X00,0X3F,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XFC,0X00,0X00,0X07,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XF8,0X23,0XF8,0XC1,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XF1,0XF3,0XF8,0XF8,0XF9,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XE3,0XF1,0XF1,0XFC,0X79,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XC7,0XF8,0X03,0XFE,0X79,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0XCF,0XFC,0X07,0XFE,0X39,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0X8F,0XFF,0X9F,0XFF,0X39,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0X9F,0XFF,0XFF,0XFF,0X39,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0X9E,0X7F,0XFF,0XCF,0X39,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0X9E,0X7F,0XFF,0XCF,0X39,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X33,0X9E,0X3F,0XFF,0XCF,0X39,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X30,0X00,0X00,0X00,0X00,0X01,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X30,0X00,0X00,0X00,0X00,0X01,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X3F,0XFF,0XFF,0XFF,0XFF,0XFF,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X3F,0XFF,0XFF,0XFF,0XFF,0XFF,0X8F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X0F,0XFF,0X00,0X00,0X00,0X00, 0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X0F,0XFF,0X00,0X00,0X00,0X00,]), 128, 64, 1)
    oled.show()
    time.sleep(1)

在这里插入图片描述

5、尝试转换显示一张网络图片

在这里插入图片描述

在线转换为bmp格式

在这里插入图片描述

小图片取模工具Image2Lcd来取模(通过调整亮度选取合适图案)

在这里插入图片描述

#MicroPython动手做(16)——掌控板之图片图像显示
#二只小象

from mpython import *
while True:
    oled.fill(0)
    oled.Bitmap(0, 0, bytearray([0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, 0XFF,0XF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0XFF, 0XFF,0XFF,0XFF,0XF7,0XBF,0XD0,0X03,0XFD,0XFF,0XFF,0X7C,0X63,0X9F,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XE7,0X83,0XD0,0X01,0XFD,0XFF,0XFF,0X3C,0X3F,0X9F,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XE3,0XB8,0X9C,0X0D,0XFD,0XFF,0XFF,0X0C,0X3F,0X9F,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XE8,0X00,0X3F,0XF8,0X0D,0XFF,0XFF,0X20,0X1F,0X9F,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XF2,0X8F,0XFF,0XFC,0X43,0XFF,0XFF,0X80,0X83,0X9F,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFE,0X7F,0XFF,0XFF,0XDF,0XFF,0XFF,0XFF,0X88,0X9F,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XC0,0X3F,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF, 0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,0XFF,]), 128, 64, 1)
    oled.show()

mPython 图形编程
在这里插入图片描述
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/809814.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

第120天:免杀对抗-防朔源防流量防特征CDN节点SSL证书OSS存储上线

知识点 #知识点: 1、CS-CDN节点-防拉黑 2、CS-SSL证书-防特征 3、CS-OSS存储-防流量#章节点: 编译代码面-ShellCode-混淆 编译代码面-编辑执行器-编写 编译代码面-分离加载器-编写 程序文件面-特征码定位-修改 程序文件面-加壳花指令-资源 代码加载面-D…

springCloud Eureka注册中心配置详解

1、创建一个springBoot项目 2、在springBoot项目中添加SpringCloud依赖 <dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>2021.0.3</version><type>…

IDEA 使用 maven 搭建 spring mvc

1. 创建项目 1.1 创建成功之后配置 Spring MVC 1.2 勾选 Spring MVC 2.更改配置文件 2.1 更改web.xml配置 更改为 <servlet-mapping><servlet-name>dispatcher</servlet-name><url-pattern>/</url-pattern></servlet-mapping>2.2 dispat…

CF1833 A-E

A题 题目链接&#xff1a;https://codeforces.com/problemset/problem/1833/A 基本思路&#xff1a;for循环遍历字符串s&#xff0c;依次截取字符串s的子串str&#xff0c;并保存到集合中&#xff0c;最后输出集合内元素的数目即可 AC代码&#xff1a; #include <iostrea…

Michael.W基于Foundry精读Openzeppelin第15期——SignedMath.sol

Michael.W基于Foundry精读Openzeppelin第15期——SignedMath.sol 0. 版本0.1 SignedMath.sol 1. 目标合约2. 代码精读2.1 max(int256 a, int256 b) && min(int256 a, int256 b)2.2 average(int256 a, int256 b)2.3 abs(int256 n) 0. 版本 [openzeppelin]&#xff1a;v…

final的使用以及权限修饰符

final表示最终的、不可改变的 final跟abstract不可以同时使用&#xff0c;因为二者是冲突的。final表示不可变&#xff0c;abstrac表示必须要重写、必须要变。 常见的四种用法 修饰一个类 格式&#xff1a; public final class 类名称{ }final修饰之后&#xff0c;这个类不能…

杂谈项——关于我在bw上的见闻,以及个人对二次元游戏行业方面的前瞻

君兮_的个人主页 勤时当勉励 岁月不待人 C/C 游戏开发 Hello,米娜桑们&#xff0c;这里是君兮_&#xff0c;今天为大家带来一点不一样的&#xff0c;首先先光速叠一下甲&#xff1a; 在此说明博主并不是一个什么都知道的大佬&#xff0c;只是一个普通的老二次元以及期望以后能…

大数据-Spark批处理实用广播Broadcast构建一个全局缓存Cache

1、broadcast广播 在Spark中&#xff0c;broadcast是一种优化技术&#xff0c;它可以将一个只读变量缓存到每个节点上&#xff0c;以便在执行任务时使用。这样可以避免在每个任务中重复传输数据。 2、构建缓存 import org.apache.spark.sql.SparkSession import org.apache.s…

Xshell配置ssh免密码登录-公钥与私钥登录linux服务器

目录 简介 提示 方法步骤 步骤1&#xff1a;生成密钥公钥&#xff08;Public key&#xff09;与私钥(Private Key) 方法1&#xff1a;使用xshell工具 方法2&#xff1a;使用命令行 步骤2&#xff1a;放置公钥(Public Key)到服务器 方法1&#xff1a;&#xff08;我使用的是…

LeetCode551.Student-Attendance-Record-i<学生出勤记录 I>

题目&#xff1a; 思路&#xff1a; 遍历就完事了.连续三天不来return false; 超过两次缺勤 fasle; 代码是&#xff1a; //codeclass Solution { public:bool checkRecord(string s) {int n s.length();int abtimes0,latimes0;for(int i0;i<n;i){switch(s[i]){case(A):l…

总结942

5:40起床 6:00~7:00单词复习300个&#xff0c;记100个 7:15~8:00早读&#xff0c;《love is as strong as death》第一第二段 8:10~9:10三大计算回顾 9:15~10:06 习题880第一章基础选择纠错 10:10~10&#xff1a;30单词默写 10:30~11:40强化第一讲习题 11:40~12:30继续…

【雕爷学编程】MicroPython动手做(16)——掌控板之图片图像显示3

知识点&#xff1a;什么是掌控板&#xff1f; 掌控板是一块普及STEAM创客教育、人工智能教育、机器人编程教育的开源智能硬件。它集成ESP-32高性能双核芯片&#xff0c;支持WiFi和蓝牙双模通信&#xff0c;可作为物联网节点&#xff0c;实现物联网应用。同时掌控板上集成了OLED…

Android 设备兼容性使用详解

和你一起终身学习&#xff0c;这里是程序员Android 经典好文推荐&#xff0c;通过阅读本文&#xff0c;您将收获以下知识点: 一、设备兼容性分类二、硬件设备兼容三、软件 APP 兼容四、兼容不同语言五、兼容不同分辨率六、兼容不同屏幕方向布局七、兼容不同硬件 Feature八、兼容…

TortoiseGit安装与配置

注&#xff1a;在安装TortoiseGit之前我已经安装了git工具。 二、Git的诞生及环境配置_tortoisegit安装包_朱嘉鼎的博客-CSDN博客 1、TortoiseGit简介 TortoiseGit是基于TortoiseSVN的Git版本的Windows Shell界面。它是开源的&#xff0c;可以完全免费使用。 TortoiseGit 支持…

redis突然变慢问题定位

CPU 相关&#xff1a;使用复杂度过高命令、数据的持久化&#xff0c;都与耗费过多的 CPU 资源有关 内存相关&#xff1a;bigkey 内存的申请和释放、数据过期、数据淘汰、碎片整理、内存大页、内存写时复制都与内存息息相关 磁盘相关&#xff1a;数据持久化、AOF 刷盘策略&…

v.sqlflow.cn 上线试用

马哈鱼数据血缘工具从2023年8月开始开通国内云版本的服务&#xff0c;相比国外版本&#xff0c;访问速度有很大的提升&#xff0c;访问域名为 https://v.sqlflow.cn. 2023年8月和9月注册的用户可免费获得价值 3000 元的一年高级帐户&#xff0c;可以使用马哈鱼数据血缘工具全部…

DCGAN对抗网络用于生成动漫卡通人物(Python代码)

DCGAN全称Deep Convolutional Generative Adversarial Networks&#xff0c;中文名深度卷积对抗网络。 1.1 DCGAN的特点 DCGAN除了G网络与CNN不同之外&#xff0c;它还有以下的不同&#xff1a; 1.取消所有pooling层。G网络中使用转置卷积&#xff08;transposed convolutiona…

集合中的数据结构

栈 先进后出入口跟出口在同一侧 队列 先进先出入口跟出口在不同的一层 数组 查询快、增删慢查询快是因为数组的地址是连续的&#xff0c;我们通过数组的首地址就可以找到数组&#xff0c;之后通过数组的下标就可以访问数组的每一个元素。增删慢是因为数组的长度是固定的&…

计算机论文中名词翻译和解释笔记

看论文中一些英文的简写不知道中文啥意思&#xff0c;或者一个名词不知道啥意思。 于是自己做了一个个人总结。 持续更新 目录 SoftmaxDeep Learning(深度学习)循环神经网络(Recurrent Neural Network简称 RNN)损失函数/代价函数(Loss Function)基于手绘草图的三维模型检索(Ske…

区块链 2.0笔记

区块链 2.0 以太坊概述 相对于比特币的几点改进 缩短出块时间至10多秒ghost共识机制mining puzzle BTC:计算密集型ETH&#xff1a;memory-hard(限制ASIC) proof of work->proof of stake对智能合约的支持 BTC&#xff1a;decentralized currencyETH&#xff1a;decentral…