当前位置:网站首页>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程序。
边栏推荐
- 《看完就懂系列》天哪!搞懂节流与防抖竟简单如斯~
- Hi3516全系统类型烧录教程
- Let digital manage inventory
- Flet教程之 15 GridView 基础入门(教程含源码)
- 【最短路】ACwing 1127. 香甜的黄油(堆优化的dijsktra或spfa)
- Mastering the new functions of swiftui 4 weatherkit and swift charts
- 即刻报名|飞桨黑客马拉松第三期盛夏登场,等你挑战
- Unity中SmoothStep介绍和应用: 溶解特效优化
- UP Meta—Web3.0世界创新型元宇宙金融协议
- STM32F1与STM32CubeIDE编程实例-MAX7219驱动8位7段数码管(基于SPI)
猜你喜欢
![[filter tracking] strapdown inertial navigation pure inertial navigation solution matlab implementation](/img/14/6e440f3c4e04d9b322f0c3f43e213c.png)
[filter tracking] strapdown inertial navigation pure inertial navigation solution matlab implementation

Hi3516 full system type burning tutorial

UP Meta—Web3.0世界创新型元宇宙金融协议

Baidu digital person Du Xiaoxiao responded to netizens' shouts online to meet the Shanghai college entrance examination English composition

核舟记(一):当“男妈妈”走进现实,生物科技革命能解放女性吗?

wallys/Qualcomm IPQ8072A networking SBC supports dual 10GbE, WiFi 6
![[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]

Cmu15445 (fall 2019) project 2 - hash table details

【神经网络】卷积神经网络CNN【含Matlab源码 1932期】

powershell cs-UTF-16LE编码上线
随机推荐
Use references
[full stack plan - programming language C] basic introductory knowledge
Improve application security through nonce field of play integrity API
In my limited software testing experience, a full-time summary of automation testing experience
[shortest circuit] acwing 1127 Sweet butter (heap optimized dijsktra or SPFA)
Swiftui swift internal skill how to perform automatic trigonometric function calculation in swift
Flet tutorial 17 basic introduction to card components (tutorial includes source code)
College entrance examination composition, high-frequency mention of science and Technology
What is high cohesion and low coupling?
Some opinions and code implementation of Siou loss: more powerful learning for bounding box regression zhora gevorgyan
Ask about the version of flinkcdc2.2.0, which supports concurrency. Does this concurrency mean Multiple Parallelism? Now I find that mysqlcdc is full
HCIA复习整理
顶级域名有哪些?是如何分类的?
Sonar:Cognitive Complexity认知复杂度
【纹理特征提取】基于matlab局部二值模式LBP图像纹理特征提取【含Matlab源码 1931期】
Complete collection of common error handling in MySQL installation
核舟记(一):当“男妈妈”走进现实,生物科技革命能解放女性吗?
NPC Jincang was invited to participate in the "aerospace 706" I have an appointment with aerospace computer "national Partner Conference
110. Network security penetration test - [privilege promotion 8] - [windows sqlserver xp_cmdshell stored procedure authorization]
@Bean与@Component用在同一个类上,会怎么样?