ev3dev python电源脚本

2024-09-26 18:06:35 发布

您现在位置:Python中文网/ 问答频道 /正文

ev3dev stretch版本2019年4月14日从这里下载

https://github.com/ev3dev/ev3dev-lang-python

运行这个python脚本来查看我的ev3dev上的电源发生了什么。除了注释掉的代码(报告为未知变量)之外还能工作

这应该是什么意思

#!/usr/bin/env python3
from ev3dev2.power import PowerSupply

power = PowerSupply()
print("amps",power.measured_amps)
print("volts",power.measured_volts)
print("type",power.type)
print("max_voltage",power.max_voltage)
print("min_voltage",power.min_voltage)
#print("measured voltage",measured_voltage)
#print("measured current",measured_current)

Tags: https版本typecurrentminmaxev3devpower

热门问题