电子发烧友App

硬声App

0
  • 聊天消息
  • 系统消息
  • 评论与回复
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
创作中心

完善资料让更多小伙伴认识你,还能领取20积分哦,立即完善>

3天内不再提示
电子发烧友网>电子资料下载>电子资料>使用TTGO ESP32和Visuino获得比特币价格

使用TTGO ESP32和Visuino获得比特币价格

2023-06-30 | zip | 0.01 MB | 次下载 | 免费

资料介绍

描述

在本教程中,我们将学习如何使用 TTGO ESP32 和 Visuino 获得美元和欧元的当前比特币价格。

第 1 步:您需要什么

  • TTGO ESP32
  • 无线网络连接
  • Visuino 程序:下载 Visuino

第 2 步:启动 Visuino,并选择 Arduino TTGO T-Display ESP32 Board Type

 
 
 
poYBAGN-28GAUDKlAADiYLrjRu0704.jpg
 
1 / 2
 

Visuino:需要安装https://www.visuino.eu 。启动Visuino,如第一图所示点击Visuino中Arduino组件(图1)上的“工具”按钮出现对话框时,选择“TTGO T-Display ESP32”,如图2所示

第 3 步:在 Visuino 中设置 WiFi

 
 
 
pYYBAGN-28OAf9FGAAAvuA2c4RM015.jpg
 
1 / 6
 

选择 TTGO T-Display ESP32 board 并在属性窗口中展开“Modules>WiFi>Connect To Access Points

单击连接到接入点 3 点

  • 在 AccessPoints 窗口中,将“WiFi Access Point”拖到左侧
  • 在属性窗口中设置SSID(您的 WiFi 热点或路由器的名称)
  • 在属性窗口中设置密码(您的 WiFi 热点或路由器的密码)
  • 关闭接入点窗口

选择 TTGO T-Display ESP32 board 并在属性窗口中展开“Modules>WiFi>Sockets

单击 Sockets3 Dots 在 Sockets 窗口中将 TCP/IP Secure Client (SSL) 拖到左侧

  • 在属性窗口中将主机设置为:blockchain.info
  • 关闭套接字窗口

第 4 步:在 Visuino 设置显示中

 
 
 
poYBAGN-28aAS9pPAABAgrsLLCI501.jpg
 
1 / 9
 

选择 TTGO T-Display ESP32 board 并在属性窗口中展开“Modules>Display>Orientation

将方向设置为:goRight

选择 TTGO T-Display ESP32 board 并在属性窗口中展开“Modules>Display>Elements

单击元素 3 点

在 Elements 窗口中,将 Draw Bitmap 拖到左侧

在属性窗口中将 Y 设置为 20,单击位图 3 Dots

在位图编辑器中加载比特币位图(图 6)并关闭位图编辑器

在 Elements 窗口中,将 Draw Text 拖到左侧

在属性窗口中将颜色设置为 aclOrange,大小设置为 2,文本设置为 USD,X 设置为 150,Y 设置为 10

在 Elements 窗口中,将 Text Field 拖到左侧

在属性窗口中设置 size 为 3,X 为 100,Y 为 35

在 Elements 窗口中,将 Draw Text 拖到左侧

在属性窗口中将颜色设置为 aclOrange,大小设置为 2,文本设置为 EUR,X 设置为 150,Y 设置为 80

在 Elements 窗口中将 Text Field 拖到左侧在属性窗口中设置 size 为 3,X 为 100,Y 为 105

关闭元素窗口

第 5 步:在 Visuino 中添加组件

 
 
 
pYYBAGN-28iAOv4gAAApSL2tnm8707.jpg
 
1 / 11
 

选择并在属性窗口中将 Host 设置为 api.coindesk.com 点击 Requests 3 Dots

  • 添加“HTTP客户端”组件
  • 在请求窗口中,将“GET”拖到左侧
  • 在属性窗口中将 URL 设置为:/v1/bpi/currentprice.json
  • 关闭请求窗口
  • 添加“HTTP Client”组件“Char To Text”组件
  • 选择“CharToText1”并在属性窗口中将 Max Length 设置为 2000
  • 添加“时钟发生器”组件
  • 选择“ClockGenerator1”并在属性窗口中将频率设置为 0.1
  • 添加“延迟”组件
  • 选择“Delay1”并在属性窗口中将 Interval 设置为 2000000
  • 添加“拆分 JSON 对象”组件

第 6 步:在 Visuino 中解析 JSON

 
 
 
pYYBAGN-28yAZzKJAAAnC9yw9PE760.jpg
 
1 / 2
 

{"time":{"updated":"Sep 18, 2013 17:27:00 UTC","updatedISO":"2013-09-18T17:27:00+00:00"},"disclaimer":"This data was produced from the CoinDesk Bitcoin Price Index. Non-USD currency data converted using hourly conversion rate from openexchangerates.org","bpi":{"USD":{"code":"USD","symbol":"$","rate":"126.5235","description":"United States Dollar","rate_float":126.5235},"GBP":{"code":"GBP","symbol":"£","rate":"79.2495","description":"British Pound Sterling","rate_float":79.2495},"EUR":{"code":"EUR","symbol":"€","rate":"94.7398","description":"Euro","rate_float":94.7398}}}

  • Close the "JSON Object" window
  • "SplitJSON1" component will now create new pins

Step 7: In Visuino Connecting Components

 
 
 
poYBAGN-28-AM2IdAAFfmdgu4TE122.png
 
1 / 3
 
  • Connect "ClockGenerator1" pin Out to "HTTPClient1" pin Clock and "Delay1" pin Start
  • Connect "HTTPClient1" pin Content to "CharToText1" pin In
  • Connect "HTTPClient1" pin to TTGO T-Display ESP32 > WiFi>TCP Secure Client1 pin In
  • Connect "Delay1" pin Out to "CharToText1" pin Clock and TTGO T-Display ESP32 > WiFi>TCP Secure Client1 pin Disconnect
  • Connect "CharToText1" pin Out to "SplitJSON1" pin In
  • Connect "SplitJSON1>USD>rate_float to TTGO T-Display ESP32>Text Field1 pin In
  • Connect "SplitJSON1>EUR>rate_float to TTGO T-Display ESP32>Text Field1 pin In

Note: you can also play with the other pins from "SplitJSON1" component

Step 8: Generate, Compile, and Upload the Code

pYYBAGN-29KASwMkAAH8xCg5814027.jpg
 

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Step 9: Play

If you power the TTGO ESP32 module it will connect to the network and display the current Bitcoin price in USD and EUR

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this tutorial, you can download it and open it in Visuino: https://www.visuino.eu


下载该资料的人也在下载 下载该资料的人还在阅读
更多 >

评论

查看更多

下载排行

本周

  1. 1山景DSP芯片AP8248A2数据手册
  2. 1.06 MB  |  532次下载  |  免费
  3. 2RK3399完整板原理图(支持平板,盒子VR)
  4. 3.28 MB  |  339次下载  |  免费
  5. 3TC358743XBG评估板参考手册
  6. 1.36 MB  |  330次下载  |  免费
  7. 4DFM软件使用教程
  8. 0.84 MB  |  295次下载  |  免费
  9. 5元宇宙深度解析—未来的未来-风口还是泡沫
  10. 6.40 MB  |  227次下载  |  免费
  11. 6迪文DGUS开发指南
  12. 31.67 MB  |  194次下载  |  免费
  13. 7元宇宙底层硬件系列报告
  14. 13.42 MB  |  182次下载  |  免费
  15. 8FP5207XR-G1中文应用手册
  16. 1.09 MB  |  178次下载  |  免费

本月

  1. 1OrCAD10.5下载OrCAD10.5中文版软件
  2. 0.00 MB  |  234315次下载  |  免费
  3. 2555集成电路应用800例(新编版)
  4. 0.00 MB  |  33566次下载  |  免费
  5. 3接口电路图大全
  6. 未知  |  30323次下载  |  免费
  7. 4开关电源设计实例指南
  8. 未知  |  21549次下载  |  免费
  9. 5电气工程师手册免费下载(新编第二版pdf电子书)
  10. 0.00 MB  |  15349次下载  |  免费
  11. 6数字电路基础pdf(下载)
  12. 未知  |  13750次下载  |  免费
  13. 7电子制作实例集锦 下载
  14. 未知  |  8113次下载  |  免费
  15. 8《LED驱动电路设计》 温德尔著
  16. 0.00 MB  |  6656次下载  |  免费

总榜

  1. 1matlab软件下载入口
  2. 未知  |  935054次下载  |  免费
  3. 2protel99se软件下载(可英文版转中文版)
  4. 78.1 MB  |  537798次下载  |  免费
  5. 3MATLAB 7.1 下载 (含软件介绍)
  6. 未知  |  420027次下载  |  免费
  7. 4OrCAD10.5下载OrCAD10.5中文版软件
  8. 0.00 MB  |  234315次下载  |  免费
  9. 5Altium DXP2002下载入口
  10. 未知  |  233046次下载  |  免费
  11. 6电路仿真软件multisim 10.0免费下载
  12. 340992  |  191187次下载  |  免费
  13. 7十天学会AVR单片机与C语言视频教程 下载
  14. 158M  |  183279次下载  |  免费
  15. 8proe5.0野火版下载(中文版免费下载)
  16. 未知  |  138040次下载  |  免费