当前位置:网站首页>EPP+DIS学习之路(1)——Hello world!
EPP+DIS学习之路(1)——Hello world!
2022-07-07 10:12:00 【MakeMaker】
在公众号“宁中物理创新实验室”写了好多基于Mixly的入门篇了,感觉自己写代码的能力也在不断的下降中......由于浙江省的信息技术选考已经要考phthon编程了,所以想着如果ESP32+Python+Phyphox这三者结合起来(简称EPP吧)开发物理的DIS实验的话,那真的可以做到多课程的完美融合了。所以便有了开发基于这三者的选修课程的想法,争取这个暑假开发完,下个学期就可以在社团课上给学生们上了。
之前的文章大多是我自己以前的经验写出来的,那么接下去的这些就是我的学习之路了,虽然也会一点python,但是还是粗浅的很,所以就一边写一边学习了。
ESP32上的python严格的应该叫micropython,有很多软件可以用,我们就挑一个比较简单的软件——Thonny来写吧。
python是一种解释型的高级语言......关于语言的介绍自己去百度了。用python来给ESP32写程序最爽的就是速度超级超级快!比起Mixly速度大约快100倍!废话不说,进入正题:
一、Thonny
首先下载软件,大家可以百度,去官网下,这样可以下到最新的,当然也可以用我分享的。
链接:https://pan.baidu.com/s/1BMrNs1Lz6HNciNFjFs7h-A?pwd=nbzx
提取码:nbzx
下载完后安装

非常干净简洁的一款软件。然后为了给ESP32写程序,还得给ESP32写入支持micropython的固件,大家可以百度也可以用我下面的:
链接:https://pan.baidu.com/s/1S3iIFn6btyQ2L22N7345AQ?pwd=nbzx
提取码:nbzx
下载后就是一个.bin的文件

接下去我们先用Thonny给ESP32来烧入新的固件:
先打开工具-设置-解码器,注意上面选择MicroPython(ESP),Port里选择你的ESP32对应的COM口(当然先得插入ESP32),然后点击右下角Install......

打开后如下,同样Port是你的ESP32对应的COM口,Firmware就是我上面分享的.bin文件。之后就点击安装即可。


大约100秒后就烧录完了。然后关闭进入Thonny主页面:

二、Hello world!
主页面下面的Shell里会出现Python的对话框。因为是高级语言,它支持对话式编程,我们先来和新世界打个招呼,在Shell栏内输入print("Hello world!")

然后它就输出了Hello world!
注意,此刻可是ESP32输出的Hello world!玩硬件的一般不喜欢这种打招呼的方式,我们的问候方式一般是点个灯!下面就把ESP32上板载的灯点亮。
在程序编辑区输入:
import machinepin = machine.Pin(2, machine.Pin.OUT)pin.on()

然后点击那个绿色圆中间有个白色箭头的按钮,之后会出来一个对话框

问你想将程序保存在哪,当然选择MicroPython设备

在File name中输入main.py,点确定。
然后过不了一秒,程序就上传完了,观察一下ESP32上的灯是不是亮了呢!
点灯后你应该能明白ESP32上Micropython运行的机制,其实就是把我们要运行的程序命名为main.py然后上传到ESP32上就可以了,ESP32一通电就会自动运行这个main程序。
边栏推荐
- [filter tracking] strapdown inertial navigation simulation based on MATLAB [including Matlab source code 1935]
- College entrance examination composition, high-frequency mention of science and Technology
- 关于 Web Content-Security-Policy Directive 通过 meta 元素指定的一些测试用例
- Basic introduction to the 16 tabs tab control in the fleet tutorial (the tutorial includes source code)
- Hi3516全系统类型烧录教程
- The Oracle message permission under the local Navicat connection liunx is insufficient
- Summed up 200 Classic machine learning interview questions (with reference answers)
- 千人規模互聯網公司研發效能成功之路
- Time bomb inside the software: 0-day log4shell is just the tip of the iceberg
- C#中在路径前加@的作用
猜你喜欢

盘点JS判断空对象的几大方法
![[filter tracking] comparison between EKF and UKF based on MATLAB extended Kalman filter [including Matlab source code 1933]](/img/90/ef2400754cbf3771535196f6822992.jpg)
[filter tracking] comparison between EKF and UKF based on MATLAB extended Kalman filter [including Matlab source code 1933]

【滤波跟踪】基于matlab扩展卡尔曼滤波EKF和无迹卡尔曼滤波UKF比较【含Matlab源码 1933期】

@What happens if bean and @component are used on the same class?

Cmu15445 (fall 2019) project 2 - hash table details

【数据聚类】基于多元宇宙优化DBSCAN实现数据聚类分析附matlab代码

【紋理特征提取】基於matlab局部二值模式LBP圖像紋理特征提取【含Matlab源碼 1931期】

In my limited software testing experience, a full-time summary of automation testing experience

Onedns helps college industry network security

MATLAB实现Huffman编码译码含GUI界面
随机推荐
sql里,我想设置外键,为什么出现这个问题
Rationaldmis2022 array workpiece measurement
Superscalar processor design yaoyongbin Chapter 9 instruction execution excerpt
2022年在启牛开华泰的账户安全吗?
Superscalar processor design yaoyongbin Chapter 10 instruction submission excerpt
Zero shot, one shot and few shot
How to write test cases for test coupons?
源代码防泄密中的技术区别再哪里
Flet教程之 16 Tabs 选项卡控件 基础入门(教程含源码)
Reasons for the failure of web side automation test
Hi3516全系统类型烧录教程
【玩转 RT-Thread】 RT-Thread Studio —— 按键控制电机正反转、蜂鸣器
5V串口接3.3V单片机串口怎么搞?
Poor math students who once dropped out of school won the fields award this year
Introduction to three methods of anti red domain name generation
Flet教程之 18 Divider 分隔符组件 基础入门(教程含源码)
wallys/Qualcomm IPQ8072A networking SBC supports dual 10GbE, WiFi 6
Swiftui swift internal skill how to perform automatic trigonometric function calculation in swift
The function of adding @ before the path in C #
@What happens if bean and @component are used on the same class?