Plotting sensor values using pyfirmata & dynamic plotting || using python & Firmata Arduino

preview_player
Показать описание
This a simple testing project where a LDR sensor is connected to an Arduino and the sensor's value gets plotted in my desktop. I have used pyfirmata and dynamic plotting. For any details, please comment, i'll try to help you out.

IDE USED
Arduino (Free)
Spyder(Free)

CODE FOR SPYDER


from matplotlib import pyplot
import pyfirmata
import time
from drawnow import *
port = "COM2"
board = pyfirmata.Arduino(port)
def makeFig():
pData=[]

while True:
drawnow(makeFig)
Рекомендации по теме
Комментарии
Автор

Very nice video...good.job...keep going....hope fr the best 🤘

anojjamohanta
Автор

nice but my code crashes after it runs one time on COM error :: COM not detected I tried using board.exit() but someone told me to use callback function as well for digital output which LDR attached to LED . HOW to do it please help ??

prabhjot
welcome to shbcf.ru