第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

交互式繪圖后 matplotlib 沒有響應

交互式繪圖后 matplotlib 沒有響應

慕哥9229398 2021-07-11 12:14:06
我正在使用 Arduino 和 python 進行一個項目,我正在使用庫(pyfirmata,matplot,draw now)繪制來自 Arduino 的實時傳感器數(shù)據(jù),我正在獲得實時輸出,但在固定迭代后,數(shù)字沒有響應。我附上了下面的代碼import pyfirmataimport timeimport matplotlib.pyplot as pltfrom drawnow import *import sysboard = pyfirmata.Arduino('COM8')iter8 = pyfirmata.util.Iterator(board)iter8.start()LED = board.get_pin('d:13:o')ldr=board.get_pin('a:0:o')val=0converted=1023converted2=5.0/1023.0s=[]i=0def makeFig():    plt.figure(1)    plt.ion()    plt.plot(s)    plt.title('My Live Streaming Sensor Data')  # Plot the title    plt.grid(True)while(i<=50):    time.sleep(0.01)    val=ldr.read()    print(val * converted * converted2)    s.append(val)    i=i+1    drawnow(makeFig)  # Call drawnow to update our live graph    plt.pause(.000001)plt.show()我想在一些迭代后保存?zhèn)鞲衅骼L圖,這是我的最終目標
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 540 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號