1 Star 2 Fork 1

KimferLang/kalman-filter-battery-soc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Arduino_serial_reader.py 776 Bytes
一键复制 编辑 原始数据 按行查看 历史
import serial
def main():
# declare port, baud, and file path
serial_port = '/dev/cu.usbmodem14201'
baud_rate = 9600
write_to_file_path = "Samsung_18650_set3_run_1.csv"
# open file for writing and get serial feed
output_file = open(write_to_file_path, "w+")
ser = serial.Serial(serial_port, baud_rate)
# write serial output to a csv file
output_file.write("Data Point" + "," + "Voltage" + "\n")
while True:
line = ser.readline()
line = line.decode("utf-8")
data_line = line
print(line, end="")
output_file.write(line)
voltage = float(data_line.split(",")[1])
# when batteries have been depleted
if voltage < 2.40:
break
output_file.close()
main()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/kimferlang/kalman-filter-battery-soc.git
git@gitee.com:kimferlang/kalman-filter-battery-soc.git
kimferlang
kalman-filter-battery-soc
kalman-filter-battery-soc
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385