高效数字货币ePaper行情显示器:Cryptocurrency ePaper Ticker

高效数字货币ePaper行情显示器:Cryptocurrency ePaper Ticker

Action Shot

这款Cryptocurrency ePaper Ticker是一款基于Python的 Raspberry Pi 应用,搭配了2.7英寸黑白电子纸显示屏,能实时显示数字货币价格信息。程序默认每5分钟从CoinGecko获取数据并更新到电子纸上,你可以设定显示的交易所、关注的币种以及货币单位。

只需几分钟的设置,你就能拥有一款低调而实用的桌面加密货币监控器,时刻追踪你的数字资产动态。

(支持所有在CoinGecko上列出的币种和货币单位)

开始使用

先决条件

确保Raspberry Pi已连接互联网,安装了pippython3。还需启用SPI接口,以便与电子纸屏幕交互。

sudo apt-get update
sudo apt-get install -y python3-pip mc git libopenjp2-7
sudo apt-get install -y libatlas-base-dev python3-pil python3-numpy python3-matplotlib
sudo raspi-config nonint do_spi 0
cd ~
git clone https://github.com/waveshare/e-Paper
git clone https://github.com/veebch/btcticker.git
cd btcticker
cp config_example.yaml config.yaml
cp -r ~/e-Paper/RaspberryPi_JetsonNano/python/lib/waveshare_epd .
rm -rf ~/e-Paper
python3 -m pip install -r requirements.txt

然后配置自动启动服务,并重启Raspberry Pi:

cat <<EOF | sudo tee /etc/systemd/system/btcticker.service
[Unit]
Description=btcticker
After=network.target

[Service]
ExecStart=/usr/bin/python3 -u /home/pi/btcticker/btcticker.py
WorkingDirectory=/home/pi/btcticker/
StandardOutput=inherit
StandardError=inherit
Restart=always
User=pi

[Install]
WantedBy=multi-user.target
EOF
sudo systemctl enable btcticker.service
sudo systemctl start btcticker.service
sudo reboot

按钮控制

如果电子屏上有按钮,可以实现以下功能:

  • 按钮1:循环切换数字货币
  • 按钮2:逆时针旋转90度
  • 按钮3:反色显示
  • 按钮4:循环切换法币单位

更新频率可在配置文件中调整(默认为300秒)。

配置文件

通过修改config.yaml文件可以调整各种选项:

display:
  cycle: true 
  cyclefiat: true 
  inverted: false 
  orientation: 90 
  trendingmode: false 
  showvolume: false 
  showrank: false 
  24h: true 
  locale: en_US 
ticker:
  currency: bitcoin,ethereum,cardano 
  exchange: default 
  fiatcurrency: usd,btc,gbp 
  sparklinedays: 1 
  updatefrequency: 300 

可选值

  • cycle: 设置为true将循环显示列表中的数字货币,设置为false只显示第一个。
  • cyclefiat: 设置为true则循环显示法币,反之仅显示第一个。
  • inverted: false为黑色文本,灰色背景;true为灰色文本,黑色背景。
  • orientation: 屏幕旋转角度,可取值0,90,180,270
  • trendingmode: 当设置为true时,会显示Coingecko上的热门币种。
  • showvolume, showrank: 显示或隐藏交易量和排名。
  • currency: 要显示的币种(必须是Coingecko ID)。
  • exchange: 默认使用Coingecko价格,也可设置特定交易所如gdax(Coinbase)、binancekraken
  • fiatcurrency: 当cyclefiat设为True时也会循环,否则只使用第一个(可通过按键切换)。
  • sparklinedays: 图表显示的历史数据天数。
  • updatefrequency: 更新间隔(秒)。

热门模式

开启"热门模式"后,除了你指定的币种,还会显示Coingecko上的7个热门币种(见下图)。

Action Shot

贡献代码

欢迎fork仓库并创建特性分支,提交pull request。

相关链接

观看设备运行视频:点此查看

  • 完整组装产品或定制框架:veeb.ch

许可证

本项目遵循GNU通用公共许可证v3.0。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

芮伦硕

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值