![]() # function for writing the arduino readings into a file Time.sleep(10) #allow time for arduino to reset SensorDataFileName = r"C:\Users\c圓16\Documents\FYP\SensorData.txt"Ĭap = cv2.VideoCapture(0) # 0 for video camera # configure serial for reading from arduino It works correctly and give me readings every fixed intervalĪnd could be graphed or viewed in the arduino ide integrated serial monitor Val = analogRead(analogPin) // read the input pin If( millis() % 20 != 0 ) // so a reading is taken every 2 milliseconds put your main code here, to run repeatedly: put your setup code here, to run once: I closed my arduino ide while running the python code, learned from past mistakes that the com port can only be accessed by one application at a time int analogPin = A0
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |