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

news2024/9/25 21:26:19

知识点:什么是掌控板?
掌控板是一块普及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通讯协议

在这里插入图片描述
在这里插入图片描述
6、动态的火柴人
打开mpythonX,连接掌控板,打开文件管理,新建文件夹(命名为pbm),然后将转好的pbm文件一个一个的上传至掌控板。

在这里插入图片描述

#MicroPython动手做(16)——掌控板之图片图像显示
#动态的火柴人

from mpython import *
import time

image_picture = Image()


while True:
    for i in range(8):
        oled.fill(0)
        oled.blit(image_picture.load(str(str("pbm/") + str((str(i)))) + str(".pbm"), 0), 0, 0)
        oled.show()
        time.sleep_ms(50)

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

7、OLED屏播放Bad Apple!!

#MicroPython动手做(16)——掌控板之图片图像显示
#OLED屏播放Bad Apple!!

from mpython import *
import time

image_picture = Image()


while True:
    for i in range(75):
        oled.fill(0)
        oled.blit(image_picture.load(str(str("pbm/") + str((str(i)))) + str(".pbm"), 0), 0, 0)
        oled.show()
        time.sleep_ms(50)

mPython X 图形编程
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
8、A、B键控制图片转换显示

#MicroPython动手做(16)——掌控板之图片图像显示
#A、B键控制图片转换显示

from mpython import *
import music

def callback_button_a_pressed():
  oled.fill(0)
  bmp_wZZv = 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,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,0xfb,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x89,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x19,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x39,0xff,0xff,0xff,0xff,0xff,0x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0xff,0xfc,0xf9,0xff,0xff,0xfe,0xf,0xff,0xff,0x3,0xff,0xe0,0x0,0x0,0x0,0x3f,0xff,0xfc,0xf9,0xff,0xff,0xff,0xbf,0xff,0xff,0xc1,0xff,0x87,0xff,0xff,0xff,0xff,0xff,0xfc,0xf9,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0xfc,0xf9,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe7,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xf9,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x79,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x39,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x99,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfb,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])
  oled.Bitmap(0, 0, bmp_wZZv, 128, 64, 1)
  oled.show()


def callback_button_b_pressed():
  oled.fill(0)
  bmp_h61P = 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,0xdf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x83,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x99,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x9c,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x9e,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x9f,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xe7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x9f,0x3f,0xff,0xff,0xff,0xff,0xff,0xf8,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0x9f,0x3f,0xff,0xff,0xff,0xff,0xff,0xe1,0xff,0x83,0xff,0xff,0xfd,0xff,0xff,0xff,0x9f,0x3f,0xff,0xfc,0x0,0x0,0x0,0x7,0xff,0xc0,0xff,0xff,0xf0,0x7f,0xff,0xff,0x9f,0x3f,0xff,0xfc,0x0,0x0,0x0,0x1f,0xfc,0x0,0x7f,0xff,0xe6,0x0,0x1f,0xff,0x9f,0x3f,0xff,0xf9,0xff,0xcf,0xfe,0x3f,0xf0,0xff,0x1f,0xff,0xc0,0x0,0x7,0xff,0x9f,0x7f,0xf0,0x1,0xff,0xcf,0xfc,0x7f,0xe7,0xff,0x9f,0xc0,0x0,0x0,0x3,0xff,0x9e,0x60,0x0,0x1,0xff,0xcf,0xfc,0xff,0x8f,0xff,0xce,0x3,0xff,0xf0,0x1,0xff,0x9f,0x0,0x0,0x1,0xff,0xcf,0xf9,0xff,0x9f,0xff,0xe0,0x7f,0xff,0xf8,0x0,0xff,0x9f,0x0,0x0,0x1,0xff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,0xe3,0xff,0xff,0xf0,0x0,0xf,0x9f,0x0,0x0,0x1,0xff,0xcf,0xf1,0xff,0x0,0xf,0xe0,0xff,0xff,0xf0,0x0,0x7,0x9f,0x7e,0x0,0x1,0xff,0xcf,0xf9,0xff,0x83,0xff,0xce,0x3,0xff,0xe0,0x0,0x7f,0x9f,0x7f,0xfc,0x1,0xff,0xcf,0xfc,0xff,0xc3,0xff,0xcf,0xc0,0x0,0x0,0x1,0xff,0x9f,0x3f,0xff,0xf9,0xff,0xcf,0xfe,0x7f,0xe3,0xff,0x9f,0xff,0x80,0x0,0x7,0xff,0x9f,0x3f,0xff,0xfd,0xff,0xcf,0xff,0x3f,0xf0,0x7e,0x3f,0xff,0xe7,0x0,0x1f,0xff,0x9f,0x3f,0xff,0xfc,0x0,0x0,0x0,0xf,0xfe,0x0,0x7f,0xff,0xf0,0x3f,0xff,0xff,0x9f,0x3f,0xff,0xfe,0x0,0x0,0x0,0x7,0xff,0xc1,0xff,0xff,0xfc,0xff,0xff,0xff,0x9f,0x7f,0xff,0xff,0xff,0xff,0xff,0xf0,0x58,0x7,0xff,0xff,0xff,0xff,0xff,0xff,0x9e,0x7f,0xff,0xff,0xff,0xff,0xff,0xfc,0x0,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0x9c,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x98,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x91,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdf,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,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff])
  oled.Bitmap(0, 0, bmp_h61P, 128, 64, 1)
  oled.show()


def on_button_a_pressed():
  while True:
    if button_a.value() == 0:
      yield callback_button_a_pressed()
    else:
      yield

def on_button_b_pressed():
  while True:
    if button_b.value() == 0:
      yield callback_button_b_pressed()
    else:
      yield

func_button_a_pressed = on_button_a_pressed()
func_button_b_pressed = on_button_b_pressed()
while True:
  next(func_button_a_pressed)
  next(func_button_b_pressed)

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

9、A、B按键调速的十帧动画片

使用掌控板上的两个按键控制动画播放的速度。按下A,速度减慢;按下B,速度加快。

在这里插入图片描述

Mind+ 图形编程

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

在这里插入图片描述

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

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

相关文章

Android 设备兼容性使用详解

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

TortoiseGit安装与配置

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

redis突然变慢问题定位

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

v.sqlflow.cn 上线试用

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

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

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

集合中的数据结构

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

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

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

区块链 2.0笔记

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

一篇文章搞定克拉美罗界(CRB)

起因: 二郎最近在研究LBL(长基线)定位,大部分论文都提到了文中算法获得的方差接近CRB,所以自己的算法性能较好。于是二郎就想知道克拉美罗界是什么意思,以及能应用的场景。 经过: 1&#xff…

python整理

Python 整理(更新中) 一、环境搭建 1- 下载python解析器 下载地址:https://www.python.org/ 2- 安装解析器: 3.pycharm 安装操作 1- 下载pycharm 下载地址: https://www.jetbrains.com/pycharm/ pycharm开发第一个Python程序 在这…

20.0 HTTP 通信

1. web开发 1.1 web开发介绍 Web指的是World Wide Web(万维网), 是一种基于互联网的信息系统. 万维网由一系列通过超文本链接相互连接的页面组成, 这些页面中包含了文本, 图像, 音频, 视频等多媒体内容. 用户可以通过浏览器访问万维网上的网页, 并通过超链接在不同页面之间导…

Flowable-中间事件-消息中间捕获事件

定义 消息中间事件指在流程中将一个消息事件作为独立的节点来运行。它是一种捕获事件,当流程 执行到消息中间事件时就会中断在这里,一直等待被触发,直接到该事件接收到相应的消息后,流 程沿后继路线继续执行。消息事件是一种引用…

网络编程(10) : 从connect到三次握手建立连接,再从close到四次挥手断开连接

1、TCP前置知识 1.1什么是TCP TCP 是面向连接的、可靠的、基于字节流的传输层通信协议。 面向连接:必须是一对一建立连接后才能通信可靠的:无论网络链路出现怎么样的变化,TCP可以保证报文一定能被对端收到字节流:流式协议&#…

QGraphicsView实现简易地图1『加载离线瓦片地图』

最简单粗暴的加载方式,将每一层级的所有瓦片地图全部加载 注:该方式仅能够在瓦片地图层级较低时使用,否则卡顿!!! 瓦片地图数据来源:水经注-高德地图-卫星地图 瓦片地图瓦片大小:25…

损失函数篇 | YOLOv8 更换损失函数之 MPDIoU | 《2023 一种用于高效准确的边界框回归的损失函数》

论文地址:https://arxiv.org/pdf/2307.07662v1.pdf 边界框回归(Bounding Box Regression,BBR)在目标检测和实例分割中得到了广泛应用,是目标定位的重要步骤。然而,对于边界框回归的大多数现有损失函数来说,当预测的边界框与真值边界框具有相同的长宽比,但宽度和高度的…

想学Python高级编程?必须了解这个小技巧:match-case!

大家好,这里是程序员晚枫,小破站/知乎/小红书/抖音都叫这个名字。 上次给大家分享了Python高级编程第一讲:从使用类型提示开始 ;今天分享Python高级编程第二讲:深入解析Python中switch case的使用方法。 写在前面 分…

Python时间处理:探索time模块

日常工作中,经常涉及到一些时间的转换操作,比如某些业务针对时间的操作要转成不同的时区,有的要转换格式入库,有的需要跟时间对比等等,接下来我们一起来看一下python里面是怎么去处理时间的。 time模块简单介绍 Python…

C语言实现扫雷游戏

test.c源文件 - 扫雷游戏测试 game.h头文件 - 扫雷游戏函数的声明 game.c源文件 - 扫雷游戏函数的实现 1.布置雷 -- 存放雷的雷盘 9*9 数组设计成11*11 上下左右方各多一行,保证周围8的范围 雷 - 1 不是雷 - 0 2.排查雷 主题测试源文件代码 &…

MySQL基础扎实——如何优化DISTINCT

在优化 MySQL 中的 DISTINCT 查询时,以下是一些常见的方法和技巧: 索引优化:为涉及 DISTINCT 的列创建索引。索引可以加速列值的查找和比较,以提高查询性能。请注意,在表中存在大量重复值的情况下,索引可能…

[个人笔记] vCenter设置时区和NTP同步

VMware虚拟化 - 运维篇 第三章 vCenter设置时区和NTP同步 VMware虚拟化 - 运维篇系列文章回顾vCenter设置时区和NTP同步(附加)ESXi设置alias参考链接 系列文章回顾 第一章 vCenter给虚机添加RDM磁盘 第二章 vCenter回收活跃虚拟机的剩余可用空间 vCente…