17、树莓派Pico的MicroPython编程入门

树莓派Pico的MicroPython编程入门

1. 树莓派Pico引脚介绍

树莓派Pico有多种引脚,每种引脚都有其特定的功能,以下是主要引脚的介绍:
| 引脚名称 | 电压 | 功能 |
| — | — | — |
| VSYS | ~2 - 5 volts | 直接连接到Pico的内部电源,关闭此电源会同时关闭Pico |
| VBUS | 5 volts | 从Pico的微型USB端口获取5V电源,用于为需要超过3.3V电源的硬件供电 |
| GND | 0 volts | 接地连接,用于完成连接到电源的电路。Pico上分布着多个GND引脚,方便布线 |
| GPxx | - | 通用输入/输出引脚,编号从GP0到GP28 |
| GPxx_ADCx | - | 通用输入/输出引脚,带有模拟输入功能,编号为‘xx’,模拟输入编号为‘x’。以ADC和数字结尾的GPIO引脚可作为模拟输入以及数字输入或输出,但不能同时使用 |
| ADC_VREF | - | 模数转换器(ADC)电压参考,为任何模拟输入设置参考电压的特殊输入引脚 |
| AGND | 0 volts | 模数转换器(ADC)的接地连接,与ADC_VREF引脚配合使用 |
| RUN | - | 启用或禁用Pico,用于从另一个微控制器或其他控制设备启动和停止Pico |

2. 连接Thonny到Pico

要使用Thonny对Pico进行编程,需要将Thonny与Pico连接起来,具体步骤如下:
1. 加载Thonny:点击屏幕左上角的树莓派菜单,将鼠标移到“编程”部分,然后点击Thonny。

相关推荐

树莓派Pico开发板与Gravity语音识别模块接口及其语音控制MicroPython编程

介绍Gravity语音识别模块的主要功能及其特性,讲述树莓派Pico与Gravity语音识别模块接口连接的基本方法,介绍使用Gravity语音识别模块学习语音唤醒词/命令词并给出I2C通信接口语音识别MicroPython库,以及基于树莓派Pico开发板和Gravity语音识别模块的语音控制MicroPython测试程序。

袁易学的博客(Yuan Yixue's Blog) 2256

树莓派33/100 - Pico控制直流小马达,为智能避障小车提供动力

用树莓派Pico控制直流小电机,需要L293D芯片,编程不复杂,再利用PWM技术,可以控制转速,最后实现正转反转的效果。

申龙斌的程序人生 4032

告别Arduino IDE:用Thonny和MicroPython玩转树莓派Pico的5个实用项目

本文介绍了如何通过Thonny和MicroPython在树莓派Pico上实现5个实用项目,告别Arduino IDE的繁琐配置。从WS2812灯带控制到微型物联网服务器,每个项目都展示了MicroPython在RP2040芯片上的独特优势,包括异步任务处理和网络通信。文章还提供了固件烧录和Thonny环境配置的进阶技巧,帮助开发者提升效率。

weixin_30983965的博客 356

树莓派PICO驱动电子墨水屏制作智能老黄历:硬件连接、MicroPython编程与低功耗设计

微控制器与嵌入式开发是物联网和智能硬件的技术基石,其核心在于通过编程控制硬件执行特定任务。树莓派PICO作为一款高性能、低成本的微控制器,凭借其双核ARM Cortex-M0+处理器和对MicroPython的友好支持,成为快速原型开发的理想选择。结合电子墨水屏(E-Ink)仅在刷新时耗电的显示保持特性,能够构建超低功耗的常显设备,在智能家居、信息展示等场景中极具技术价值。本文聚焦于利用树莓派PICO W与SPI接口电子墨水屏,实现一个自动更新、显示农历与宜忌信息的实体老黄历摆件,详细阐述了从硬件选型、电路

weixin_34290096的博客 315

15、树莓派Pico的MicroPython与电子入门指南

本文介绍了基于树莓派Pico和MicroPython的温度读取实验,详细讲解了硬件连接、代码运行及结果分析。同时为电子初学者提供了必备工具清单与使用指南,涵盖万用表的连续性、电压和电流测量方法,并强调了静电防护的重要性。结合工具选择建议与安全操作规范,帮助读者打下扎实的电子项目实践基础,顺利开启DIY电子之旅。

pz89012345的博客 112

优快云余额充值前必读:这5个隐藏条款,90%的开发者都忽略了(附iOS内购避坑指南)

本文揭示了优快云余额充值中90%开发者忽略的5个隐藏条款,包括不可退款规则、iOS内购限制、账号安全责任等关键内容,特别提供了iOS内购避坑指南,帮助开发者避免资金损失和账号风险。

weixin_26765287的博客 146

SAP PI实战:5分钟搞定REST适配器同步接口配置(含Postman测试技巧)

本文详细介绍了如何在SAP PI中快速配置REST适配器同步接口,包括ESR设计、集成流配置及Postman测试技巧。通过实战步骤和关键参数设置,帮助开发者高效实现系统集成,特别适合需要实时数据交互的业务场景。

weixin_33738555的博客 485

Palabos User Guide中文解读 | 第一章 | 介绍

译者的话:本人在学习palabos时,发现国内中文资料甚少,恰好网上可以直接搜到palabos user guide这种英文资料,加之时间充裕,便打算开始翻译,能不能完成全本翻译再说,而且文中我也会标记我不确定的地方,以传达意思为主,翻译不当的地方还请各位读者帮忙指正。 Palabos User Guide Release 1.0 r1 Copyright © 2019 University of...

Yulan Fang's notes. 6977

西电计科数据库系统期末复习笔记

本人西电19计科,数据库系统98,这是复习期间整理的笔记,基本涵盖了课程全部重点,有需要的学弟学妹可以在复习的时候参考一下。

Polaris的博客 8594

S32K144之芯片锁死解锁——关闭debug端口

S32K144之芯片锁死及解锁 经常捣鼓单片机就会发现,时常会因为某些操作不当导致芯片锁死情况的发生,通过Jlink我们可以读到芯片的ID,但是无法进行Debug,这很是让人苦恼。 基于S32K144的芯片锁死,一般有如下几种可能: 1、时钟配置异常,过高的配置时钟频率以及不配置时钟,都有可能造成芯片保护锁死,我就曾经因为不注意把时钟配置代码注释掉,导致芯片锁死。 2、我是微软雅黑烧写断电,如果在...

weixin_41935674的博客 1万+

【Python音频处理】syncstart 计算媒体文件同步时间偏移

syncstart是一个强大的工具,它简化了多媒体文件的音视频同步过程,特别适用于多设备录制的媒体内容。在使用命令行工具时,可以根据实际需求灵活调整参数,如归一化、降噪、低通滤波等,以提高同步的精度和效率。通过本文介绍的基本操作和应用示例,可以快速掌握syncstart的使用方法,并将其应用到日常的音视频处理工作中。

Mr数据杨 814

STM32声源定位:实现声源定位的嵌入式解决方案

通过以上代码,我们可以获取麦克风音频信号样本,并使用交叉相关法计算声源的位置。然而,我可以帮助您解答有关STM32声源定位的问题,提供相关的代码和指导。获取了麦克风音频信号后,我们可以使用信号处理算法来计算声源的位置。该算法通过计算不同麦克风之间的信号延迟来确定声源的方向。首先,我们需要获取每个麦克风的音频信号。声源定位是一项重要的技术,可以帮助我们确定声音的来源位置。在嵌入式系统中,使用STM32微控制器可以实现精确的声源定位。声源定位的基本原理是通过多个麦克风阵列接收到的声音信号来计算声源的位置。

UplKubernetes的博客 2581

工业相机的检测原理课件(建议收藏)

本课件为各位工程师详细介绍了工业相机的视觉检测原理 ,旨在为工程师调试工业相机的视觉检测原理时提供理论性指导。

Bamboo265925的博客 498

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

上一篇: 16、树莓派Pico与Pico W使用指南
下一篇: 8、80x86汇编语言编程入门与实践
lambda
博客等级 码龄23年 49粉丝 1303原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值