【雕爷学编程】MicroPython动手做(17)——掌控板之触摸引脚2

news2024/10/6 2:28:46

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

在这里插入图片描述
在这里插入图片描述
7、6个触摸按键控制RGB灯并显示按键名

#MicroPython动手做(17)——掌控板之触摸引脚
#6个触摸按键控制RGB灯并显示按键名

from mpython import *

from machine import Timer

import time

_status_p = _status_y = _status_t = _status_h = _status_o = _status_n = 0
def on_touchpad_P_pressed():pass
def on_touchpad_P_unpressed():pass
def on_touchpad_Y_pressed():pass
def on_touchpad_Y_unpressed():pass
def on_touchpad_T_pressed():pass
def on_touchpad_T_unpressed():pass
def on_touchpad_H_pressed():pass
def on_touchpad_H_unpressed():pass
def on_touchpad_O_pressed():pass
def on_touchpad_O_unpressed():pass
def on_touchpad_N_pressed():pass
def on_touchpad_N_unpressed():pass

tim12 = Timer(12)

def timer12_tick(_):
    global _status_p, _status_y, _status_t, _status_h, _status_o, _status_n
    try:
        touchPad_P.read();pass
    except:
        return
    if touchPad_P.read() < 400:
        if 1 != _status_p:_status_p = 1;on_touchpad_P_pressed()
    elif 0 != _status_p:_status_p = 0;on_touchpad_P_unpressed()
    if touchPad_Y.read() < 400:
        if 1 != _status_y:_status_y = 1;on_touchpad_Y_pressed()
    elif 0 != _status_y:_status_y = 0;on_touchpad_Y_unpressed()
    if touchPad_T.read() < 400:
        if 1 != _status_t:_status_t = 1;on_touchpad_T_pressed()
    elif 0 != _status_t:_status_t = 0;on_touchpad_T_unpressed()
    if touchPad_H.read() < 400:
        if 1 != _status_h:_status_h = 1;on_touchpad_H_pressed()
    elif 0 != _status_h:_status_h = 0;on_touchpad_H_unpressed()
    if touchPad_O.read() < 400:
        if 1 != _status_o:_status_o = 1;on_touchpad_O_pressed()
    elif 0 != _status_o:_status_o = 0;on_touchpad_O_unpressed()
    if touchPad_N.read() < 400:
        if 1 != _status_n:_status_n = 1;on_touchpad_N_pressed()
    elif 0 != _status_n:_status_n = 0;on_touchpad_N_unpressed()

tim12.init(period=100, mode=Timer.PERIODIC, callback=timer12_tick)

def on_touchpad_P_pressed():
    global i
    oled.fill(0)
    oled.DispChar('P', 60, 22, 1)
    oled.show()
    rgb[0] = (int(255), int(0), int(0))
    rgb.write()
    time.sleep_ms(1)
    time.sleep(1)
    rgb.fill( (0, 0, 0) )
    rgb.write()
    time.sleep_ms(1)

def on_touchpad_H_pressed():
    global i
    oled.fill(0)
    oled.DispChar('H', 60, 22, 1)
    oled.show()
    rgb[0] = (int(255), int(102), int(0))
    rgb.write()
    time.sleep_ms(1)
    time.sleep(1)
    rgb.fill( (0, 0, 0) )
    rgb.write()
    time.sleep_ms(1)

def on_touchpad_Y_pressed():
    global i
    oled.fill(0)
    oled.DispChar('Y', 60, 22, 1)
    oled.show()
    rgb[1] = (int(0), int(153), int(0))
    rgb.write()
    time.sleep_ms(1)
    time.sleep(1)
    rgb.fill( (0, 0, 0) )
    rgb.write()
    time.sleep_ms(1)

def on_touchpad_O_pressed():
    global i
    oled.fill(0)
    oled.DispChar('O', 60, 22, 1)
    oled.show()
    rgb[0] = (int(255), int(102), int(0))
    rgb.write()
    time.sleep_ms(1)
    rgb[1] = (int(255), int(102), int(0))
    rgb.write()
    time.sleep_ms(1)
    time.sleep(1)
    rgb.fill( (0, 0, 0) )
    rgb.write()
    time.sleep_ms(1)

def on_touchpad_T_pressed():
    global i
    oled.fill(0)
    oled.DispChar('T', 60, 22, 1)
    oled.show()
    rgb[2] = (int(51), int(51), int(255))
    rgb.write()
    time.sleep_ms(1)
    time.sleep(1)
    rgb.fill( (0, 0, 0) )
    rgb.write()
    time.sleep_ms(1)

def on_touchpad_N_pressed():
    global i
    oled.fill(0)
    oled.DispChar('N', 60, 22, 1)
    oled.show()
    rgb.fill((int(255), int(102), int(0)))
    rgb.write()
    time.sleep_ms(1)
    time.sleep(1)
    rgb.fill( (0, 0, 0) )
    rgb.write()
    time.sleep_ms(1)

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

8、简易触摸按键电子琴(6键)

在这里插入图片描述

#MicroPython动手做(17)——掌控板之触摸引脚
#简易触摸按键电子琴(6键)

from mpython import *

import music
while True:
    music.stop()
    if touchPad_P.read() < 400:
        music.pitch(262, 500)
    else:
        if touchPad_Y.read() < 400:
            music.pitch(294, 500)
        else:
            if touchPad_T.read() < 400:
                music.pitch(330, 500)
            else:
                if touchPad_H.read() < 400:
                    music.pitch(349, 500)
                else:
                    if touchPad_O.read() < 400:
                        music.pitch(392, 500)
                    else:
                        if touchPad_N.read() < 400:
                            music.pitch(440, 500)

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

视频:掌控板模拟简易触摸按键电子琴(6键)

https://v.youku.com/v_show/id_XNDY0ODEwMjcxMg==.html?spm=a2hbt.13141534.app.55!25!2555!255!25!25!255A

9、触摸按键点播六首曲子

#MicroPython动手做(17)——掌控板之触摸引脚
# 触摸按键点播六首曲子

from mpython import *
import time
import music
from machine import Timer

def on_button_a_down(_):
    time.sleep_ms(10)
    if button_a.value() == 1: return
    music.stop()

_status_p = _status_y = _status_t = _status_h = _status_o = _status_n = 0
def on_touchpad_P_pressed():pass
def on_touchpad_P_unpressed():pass
def on_touchpad_Y_pressed():pass
def on_touchpad_Y_unpressed():pass
def on_touchpad_T_pressed():pass
def on_touchpad_T_unpressed():pass
def on_touchpad_H_pressed():pass
def on_touchpad_H_unpressed():pass
def on_touchpad_O_pressed():pass
def on_touchpad_O_unpressed():pass
def on_touchpad_N_pressed():pass
def on_touchpad_N_unpressed():pass

tim12 = Timer(12)

def timer12_tick(_):
    global _status_p, _status_y, _status_t, _status_h, _status_o, _status_n
    try:
        touchPad_P.read();pass
    except:
        return
    if touchPad_P.read() < 400:
        if 1 != _status_p:_status_p = 1;on_touchpad_P_pressed()
    elif 0 != _status_p:_status_p = 0;on_touchpad_P_unpressed()
    if touchPad_Y.read() < 400:
        if 1 != _status_y:_status_y = 1;on_touchpad_Y_pressed()
    elif 0 != _status_y:_status_y = 0;on_touchpad_Y_unpressed()
    if touchPad_T.read() < 400:
        if 1 != _status_t:_status_t = 1;on_touchpad_T_pressed()
    elif 0 != _status_t:_status_t = 0;on_touchpad_T_unpressed()
    if touchPad_H.read() < 400:
        if 1 != _status_h:_status_h = 1;on_touchpad_H_pressed()
    elif 0 != _status_h:_status_h = 0;on_touchpad_H_unpressed()
    if touchPad_O.read() < 400:
        if 1 != _status_o:_status_o = 1;on_touchpad_O_pressed()
    elif 0 != _status_o:_status_o = 0;on_touchpad_O_unpressed()
    if touchPad_N.read() < 400:
        if 1 != _status_n:_status_n = 1;on_touchpad_N_pressed()
    elif 0 != _status_n:_status_n = 0;on_touchpad_N_unpressed()

tim12.init(period=100, mode=Timer.PERIODIC, callback=timer12_tick)

def on_touchpad_P_pressed():
    music.play(music.DONG_FANG_HONG, wait=False, loop=False)

def on_touchpad_Y_pressed():
    music.play(music.BIRTHDAY, wait=False, loop=False)

def on_touchpad_T_pressed():
    music.play(music.MO_LI_HUA, wait=False, loop=False)

def on_touchpad_H_pressed():
    music.play(music.ODE, wait=False, loop=False)

def on_touchpad_O_pressed():
    music.play(music.PRELUDE, wait=False, loop=False)

def on_touchpad_N_pressed():
    music.play(music.CAI_YUN_ZHUI_YUE, wait=False, loop=False)

button_a.irq(trigger=Pin.IRQ_FALLING, handler=on_button_a_down)


while True:
    oled.fill(0)
    oled.DispChar("A键:停止", 35, 0, 1)
    oled.DispChar("P:东方红  Y:生日快乐", 6, 20, 1)
    oled.DispChar("T:茉莉花  H:欢乐颂", 11, 35, 1)
    oled.DispChar("O:婚宴 N:彩云追月", 13, 50, 1)
    oled.show()

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

视频:触摸按键点播六首曲子

https://v.youku.com/v_show/id_XNDY1Mzc0MTc0OA==.html?spm=a2h0c.8166622.PhoneSokuUgc_1.dtitle

在这里插入图片描述

10、六个触摸键控制的RGB颜色灯

#MicroPython动手做(17)——掌控板之触摸引脚
#六个触摸键控制的RGB颜色灯

from mpython import *
import network
import time
import music
from yeelight import *
from machine import Timer

my_wifi = wifi()

my_wifi.connectWiFi("zh", "zy1567")

_status_p = _status_y = _status_t = _status_h = _status_o = _status_n = 0
def on_touchpad_P_pressed():pass
def on_touchpad_P_unpressed():pass
def on_touchpad_Y_pressed():pass
def on_touchpad_Y_unpressed():pass
def on_touchpad_T_pressed():pass
def on_touchpad_T_unpressed():pass
def on_touchpad_H_pressed():pass
def on_touchpad_H_unpressed():pass
def on_touchpad_O_pressed():pass
def on_touchpad_O_unpressed():pass
def on_touchpad_N_pressed():pass
def on_touchpad_N_unpressed():pass

tim12 = Timer(12)

def timer12_tick(_):
    global _status_p, _status_y, _status_t, _status_h, _status_o, _status_n
    try:
        touchPad_P.read();pass
    except:
        return
    if touchPad_P.read() < 400:
        if 1 != _status_p:_status_p = 1;on_touchpad_P_pressed()
    elif 0 != _status_p:_status_p = 0;on_touchpad_P_unpressed()
    if touchPad_Y.read() < 400:
        if 1 != _status_y:_status_y = 1;on_touchpad_Y_pressed()
    elif 0 != _status_y:_status_y = 0;on_touchpad_Y_unpressed()
    if touchPad_T.read() < 400:
        if 1 != _status_t:_status_t = 1;on_touchpad_T_pressed()
    elif 0 != _status_t:_status_t = 0;on_touchpad_T_unpressed()
    if touchPad_H.read() < 400:
        if 1 != _status_h:_status_h = 1;on_touchpad_H_pressed()
    elif 0 != _status_h:_status_h = 0;on_touchpad_H_unpressed()
    if touchPad_O.read() < 400:
        if 1 != _status_o:_status_o = 1;on_touchpad_O_pressed()
    elif 0 != _status_o:_status_o = 0;on_touchpad_O_unpressed()
    if touchPad_N.read() < 400:
        if 1 != _status_n:_status_n = 1;on_touchpad_N_pressed()
    elif 0 != _status_n:_status_n = 0;on_touchpad_N_unpressed()

tim12.init(period=100, mode=Timer.PERIODIC, callback=timer12_tick)

def on_touchpad_P_pressed():
    global i
    time.sleep_ms(500)
    bulb.set_rgb(153, 0, 0)
    oled.DispChar("P键  红色", 38, 32, 1)
    oled.show()
    rgb.fill((int(153), int(0), int(0)))
    rgb.write()
    time.sleep_ms(1)

def on_touchpad_Y_pressed():
    global i
    time.sleep_ms(500)
    bulb.set_rgb(0, 153, 0)
    oled.DispChar("Y键  绿色", 38, 32, 1)
    oled.show()
    rgb.fill((int(0), int(153), int(0)))
    rgb.write()
    time.sleep_ms(1)

def on_touchpad_T_pressed():
    global i
    time.sleep_ms(500)
    bulb.set_rgb(51, 51, 255)
    oled.DispChar("T键  蓝色", 38, 32, 1)
    oled.show()
    rgb.fill((int(51), int(51), int(255)))
    rgb.write()
    time.sleep_ms(1)

def on_touchpad_H_pressed():
    global i
    time.sleep_ms(500)
    bulb.set_rgb(255, 102, 0)
    oled.DispChar("H键  橙色", 38, 32, 1)
    oled.show()
    rgb.fill((int(153), int(51), int(0)))
    rgb.write()
    time.sleep_ms(1)

def on_touchpad_O_pressed():
    global i
    time.sleep_ms(500)
    bulb.set_rgb(204, 51, 204)
    oled.DispChar("O键  紫色", 38, 32, 1)
    oled.show()
    rgb.fill((int(102), int(51), int(102)))
    rgb.write()
    time.sleep_ms(1)

def on_touchpad_N_pressed():
    global i
    time.sleep_ms(500)
    bulb.set_rgb(255, 204, 51)
    oled.DispChar("N键  黄色", 38, 32, 1)
    oled.show()
    rgb.fill((int(153), int(102), int(51)))
    rgb.write()
    time.sleep_ms(1)


rgb[1] = (int(51), int(51), int(51))
rgb.write()
time.sleep_ms(1)
music.play('G5:1')
bulb = Bulb(discover_bulbs()[0]["ip"])
time.sleep_ms(500)
bulb.turn_on()
oled.fill(0)
oled.DispChar("触摸键控制RGB灯", 18, 16, 1)
oled.show()

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

#MicroPython动手做(17)——掌控板之触摸引脚
#六个触摸键控制的RGB颜色灯(实验视频)

https://v.youku.com/v_show/id_XNDcwMTY3MzkxNg==.html?spm=a2h0c.8166622.PhoneSokuUgc_1.dtitle

在这里插入图片描述
11、触摸不同按键,点亮不同色RGB灯

from mpython import *

while True:
    if(touchPad_P.read() < 100):
        rgb[0] = (255,0,0)    # 开灯,设置红色
        rgb[1] = (255,0,0)  # 设定为红色
        rgb[2] = (255,0,0)   # 设置为红色
        rgb.write()
    elif(touchPad_Y.read() < 100):
        rgb[0] = (0,255,0) #关灯
        rgb[1] = (0,255,0)
        rgb[2] = (0,255,0)
        rgb.write()
    elif(touchPad_T.read() < 100):
        rgb[0] = (0,0,255) #关灯
        rgb[1] = (0,0,255)
        rgb[2] = (0,0,255)
        rgb.write()
    elif(touchPad_H.read() < 100):
        rgb[0] = (255,255,0) #关灯
        rgb[1] = (255,255,0)
        rgb[2] = (255,255,0)
        rgb.write()
    elif(touchPad_O.read() < 100):
        rgb[0] = (255,0,255) #关灯
        rgb[1] = (255,0,255)
        rgb[2] = (255,0,255)
        rgb.write()
    elif(touchPad_N.read() < 100):
        rgb[0] = (0,255,255) #关灯
        rgb[1] = (0,255,255)
        rgb[2] = (0,255,255)
        rgb.write()

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

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

相关文章

《cuda c编程权威指南》02 - 内存管理和线程管理

一个典型的CUDA编程结构包括5个主要步骤。 分配GPU内存。从CPU内存中拷贝数据到GPU内存。调用CUDA内核函数来完成程序指定的运算。将数据从GPU拷回CPU内存。释放GPU内存空间。 这里先理一理如何分配gpu内存。 目录 1. 内存管理函数 1.1 分别内存 1.2 数据拷贝 2. gpu内存…

从互联网到云时代,Apache RocketMQ 是如何演进的?

作者&#xff1a;隆基 2022 年&#xff0c;RocketMQ 5.0 的正式版发布。相对于 4.0 版本而言&#xff0c;架构走向云原生化&#xff0c;并且覆盖了更多业务场景。 消息队列演进史 操作系统、数据库、中间件是基础软件的三驾马车&#xff0c;而消息队列属于最经典的中间件之一…

面试最常被问到的接口自动化测试面试题汇总

一、请问你是如何做接口测试的&#xff1f; 大体来说&#xff0c;经历以下过程&#xff1a;接口需求调研、接口测试工具选择、接口测试用例编写、接口测试执行、接口测试回归、接口测试自动化持续集成。具体来说&#xff0c;接口测试流程分成以下九步&#xff1a; 第一步&…

Android架构技术大纲(记录)

关于作者&#xff1a;CSDN内容合伙人、技术专家&#xff0c; 从零开始做日活千万级APP。 专注于分享各领域原创系列文章 &#xff0c;擅长java后端、移动开发、人工智能等&#xff0c;希望大家多多支持。 目录 一、导读二、概览三、目录3.0 设计模式3.1 数据结构与算法3.2 Java…

[每日习题] 完全数计算 扑克牌大小 ——牛客习题

hello&#xff0c;大家好&#xff0c;这里是bang___bang_&#xff0c;今天也还是记录2道牛客习题&#xff0c;1道简单题&#xff08;完全数计算&#xff09;&#xff1b;1道中等题&#xff08;扑克牌大小&#xff09;。 目录 1️⃣完全数计算 2️⃣扑克牌大小 1️⃣完全数计算…

Cpp05 — 内存管理

内存管理 代码是以文件的形式存储在磁盘上的。 不是说是代码就会加载到代码段&#xff0c;而是代码编译好的二进制指令代码会加载到代码段&#xff0c;然后程序中main函数执行时就是在代码段取指令来执行。栈和堆上的数据是运行时才建立的。 常量区是有硬件保护的&#xff0c…

【JAVA】java中的逻辑控制

作者主页&#xff1a;paper jie的博客 本文作者&#xff1a;大家好&#xff0c;我是paper jie&#xff0c;感谢你阅读本文&#xff0c;欢迎一建三连哦。 本文录入于《JAVASE语法系列》专栏&#xff0c;本专栏是针对于大学生&#xff0c;编程小白精心打造的。笔者用重金(时间和精…

Android应用开发(22)获取Property系统属性

Android应用开发学习笔记——目录索引 开发过程中我们经常需要获取Property系统属性&#xff0c;比如model、device、product 等等&#xff0c;通常debug的时候可以使用如下命令获取。 adb shell getprop <property name> adb shell setprop <property name> <…

Unity 四元素

//-------------旋转------------ // //设置角度 (超过90或负数时&#xff0c;会设置-1结果是359这样的问题&#xff0c;可以使用下面旋转的方式) transform.rotate new Quaternion(0,0,0,0);//Quaternion四元数 transform.localEulerAngles new Vector3(0,0,0);//EulerA…

idea集成jrebel实现热部署

文章目录 idea集成jrebel实现热部署下载jrebel 插件包下载jrebel mybatisplus extensition 插件包基础配置信息情况一其次情况三情况四情况五情况六情况七 验证生效与否 Jrebel热部署不生效的解决办法 idea集成jrebel实现热部署 在平常开发项目中&#xff0c;我们通常是修改完…

Android应用开发(23)获取亮灭屏状态

Android应用开发学习笔记——目录索引 在android 应用程序获取亮灭屏状态的常用方法有&#xff1a; 使用PowerManager提供的API函数注册Broadcast监听 一、使用PowerManager提供的API函数 frameworks/base/core/java/android/os/PowerManager.java import android.os.Buil…

Java 模块化Modularity- 了解与测试

1. java9后JDK后目录的变化 不见了jre,新增了jmods目录。 1&#xff09;为什么不见了jre&#xff1f; 新版JDK提供了 jlink工具&#xff0c;使用它构建一个包含jre镜像的应用程序。 就是可以打包一个引用程序内部已经包含完整或部分jre&#xff0c;可以直接运行。 2&#xf…

2023 7-30

题目1 lee2331.计算布尔二叉树的值 对于一棵完整的二叉树(每一个根节点孩子的个数不是0就是2) 叶子节点是1或者是0,其中1代表true,0代表false非叶子节点的值是2或者3,其中2代表逻辑或or,3代表逻辑与and计算方式 如果节点是个叶子节点,那么节点的 值 为它本身,即 True 或者…

1400*D. Pair of Topics

Examples input 5 4 8 2 6 2 4 5 4 1 3 output 7 input 4 1 3 2 4 1 3 2 4 output 0 题意&#xff1a; 选择两列&#xff0c;使得上面两个值的和比下面两个值之和大。 解析&#xff1a; 令c[ i ] a[ i ] - b[ i ]&#xff0c;转换成选两个值&#xff0c;其和大于0 排…

《MySQL 实战 45 讲》课程学习笔记(二)

日志系统&#xff1a;一条 SQL 更新语句是如何执行的&#xff1f; 与查询流程不一样的是&#xff0c;更新流程还涉及两个重要的日志模块&#xff1a;redo log&#xff08;重做日志&#xff09;和 binlog&#xff08;归档日志&#xff09;。 重要的日志模块&#xff1a;redo l…

【图论】差分约束

一.情景导入 x1-x0<9 ; x2-x0<14 ; x3-x0<15 ; x2-x1<10 ; x3-x2<9; 求x3-x0的最大值&#xff1b; 二.数学解法 联立式子2和5&#xff0c;可得x3-x0<23;但式子3可得x3-x0<15。所以最大值为15&#xff1b; 三.图论 但式子多了我们就不好解了&#xff0…

深度学习实践——循环神经网络实践

系列实验 深度学习实践——卷积神经网络实践&#xff1a;裂缝识别 深度学习实践——循环神经网络实践 深度学习实践——模型部署优化实践 深度学习实践——模型推理优化练习 代码可见于&#xff1a; 深度学习实践——循环神经网络实践 0 概况1 架构实现1.1 RNN架构1.1.1 RNN架…

【Golang】Golang进阶系列教程--为什么说 Go 语言字符串是不可变的?

文章目录 前言推荐阅读 前言 最近有读者留言说&#xff0c;平时在写代码的过程中&#xff0c;是会对字符串进行修改的&#xff0c;但网上都说 Go 语言字符串是不可变的&#xff0c;这是为什么呢&#xff1f; 这个问题本身并不困难&#xff0c;但对于新手来说确实容易产生困惑…

一起学算法(选择排序篇)

距离上次更新已经很久了&#xff0c;以前都是非常认真的写笔记进行知识分享&#xff0c;但是带来的情况并不是很好&#xff0c;一度认为发博客是没有意义的&#xff0c;但是这几天想了很多&#xff0c;已经失去了当时写博客的初心了&#xff0c;但是我觉得应该做点有意义的事&a…

数学分析:流形的线性代数回顾

因为是线性的&#xff0c;所以可以把所有的系数都提取出去。这也是多重线性代数的性质。可以看成基本的各项自变量的乘法。 这里可以看到两个不同基向量下&#xff0c;他们的坐标转化关系。 引出了张量积&#xff0c;也就是前面提到的内容。 对偶空间的例子总是比较美好。 因为…