当前位置:网站首页>用C#为国产智能手表写“Hello, China. ”
用C#为国产智能手表写“Hello, China. ”
2022-07-19 09:12:00 【dotNET跨平台】
在此之前, 我写过几篇如何使用C#编写STM32程序的例子, 那么同样, ESP32下我们也可以使用C#,我们依然仰仗于一直在发展壮大的 .Net nanoFramework , 目前他支持的开发板越来越多 , 支持的芯片种类也越来越多, 而且相关的库也越来越多, 所支持的器件完全可以支撑常规应用开发。90%的器件均可在淘宝购买。
在前段时间闲逛GitHub时发现深圳芯元电子的 LILYGO T-WATCH-2020 V3 已经被nanoFramework 所支持, 并在支持的列表中。 这让我对nanoFramework 备受鼓舞, 写下此文章, 希望有助于大家低门槛进入ESP32 的开发。
首先, 你需要淘宝上买一个设备, 我选的是 LILYGO T-WATCH-2020 V3 + CH9102F , 淘宝上可以搜到。在LILYGO的官方淘宝店就可以买到, 二百多块, 相比STM32的开发版来说, 便宜到爆。 拿到东西后充电,开机, 对自带界面没太多操作的想法, 因为要用LVGL做好一个可操作界面, 用起来跟苹果或者安卓一样, 这需要耗费大量美工和C程序员的大量时间,所以,作为一个智能手表开发板来说, 他已经演示了所有的功能, 所以, 二话不说我们直接刷固件。
安装nanoff , 他是个nanoFramework 刷bootloader 和 nanoCLR 的工具, 有了他, 你才可以通过Visual Studio 开发工具发现,命令:
dotnet tool install -g nanoff
安装完成后提示
可使用以下命令调用工具: nanoff
已成功安装工具“nanoff”(版本“2.1.7”)。
2. 使用命令 nanoff --listports 查看你的设备串口是否连接。
3. 刷固件 platform 用来指定平台, 比如stm32 或者 stm32 等,serialport 指定串口, update 的意思就是更新固件, target 就是指定已支持的目标开发板名称, 如果不指定 nanoff 会根据platform 自动指定一个。
nanoff --platform esp32 --serialport COM3 --update --target ESP32_LILYGO
注意, 这里有个不完善的地方, 如果你指定了 ESP32_LILYGO , 在VS中就无法发现他, 可能是固件没有兼容好的问题, 如果使用默认ESP32 就没有这个问题。关于这点, 我已经在相关帖子内提出了, 大家可以在遇到此问题时 跟帖 https://github.com/nanoframework/Home/issues/803#issuecomment-1186216641
如果成功, 界面应该是如下显示。
4. 打开Visual Studio , 你需要安装 .NET nanoFramework Extension ,这样你才能够在新建项目时选择nanoFramework 的项目, 如下图:
新建项目后, 项目基本结构如下:
此时, 我们需要点开 nanoFramework的设备查看器, 插上你的手表。
, 现在点击
启动后, 如下:
至此, 你的第一行代码实现, wifi、界面、数据采集, 你需要做大量工作。 但总算开头了, 希望你能从中找到乐趣。祝你好运。
边栏推荐
- Druid configuration and monitoring
- 想请教一下,我现在在珠海,到哪里开户比较好?请问手机开户股票开户安全吗?
- Sending the email to the following server failed.IOException while sending message问题解决
- 微服务--熔断和限流
- PriorityQueue -- priority queue (heap)
- Why psp22 is important to Polkadot ecosystem
- 微信小程序_18,父子组件之间的通信
- Starbucks may close more U.S. stores in the future due to concerns about the safety of employees
- File path of QGIS development plug-in
- 秋招之前,这8篇推荐系统的论文一定要读!【附论文资料】
猜你喜欢
DolphinScheduler
为什么 PSP22 对 Polkadot 生态系统很重要
PyG教程(8):计算更高效的稀疏矩阵形式
一汽红旗“王炸”上市,安全、舒适一个不落
广汽埃安新一轮引战增资正式预挂牌,资金将重点用于新产品开发、新一代电池等方面
Hackers crack gambling website vulnerabilities and "collect wool" 100000 per month
【延期公告】2022年网络与信息安全国际会议(NISecurity 2022)
收集表单数据 v-model
Shuttle + alluxio accelerated memory shuffle take-off
Unity practical problems webgl problem collection part 2
随机推荐
Notepad++ software installation tutorial
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process xxxx
NFT game interoperability: technology is not a roadblock
Application example of neural network model SPSS - typical neural network model - Application of neural network model
[papers] famous conferences and periodicals
上海证券开户安不安全?
LNMP环境, 网站无法访问
Failed to process package ‘cartographer_ros‘ :
News Express | congratulations to engineer Xiao Xiaorong for obtaining Domo professional certification!
JUC_synchronized关键字详解
Solution: the configuration and path are completely correct, but the gateway cannot be accessed
第十四篇,STM32的CAN总线通信
CDH之impala
亚马逊、Lazada、Shopee、速卖通、eBay、Wish测评自养号运营知识——环境搭建技术详解
黑客破解赌博网站漏洞每月“薅羊毛”10万
[HDU 6095] Rikka with Competition
Common construction methods and example appreciation of STL pair
Several small open source projects of mine over the years
Redis的配置
LED light of 51 single chip microcomputer