0

I want to make an interface with my arduino-uno. So i can write command in python console it will be send to the arduino, and when the arduino receives it, it display it on the arduino console if it is not a recognised command. One command i've made is when i type stream data in the python console it tells the arduino to send data from the A0 pin to the computer and display it in the python console.

The problem is after a short time it tells me :

RecursionError: maximum recursion depth exceeded in comparison 

so my question is how to have a stream of data without using recusion ?

I've searched on the internet but I cannot seem to find a precise answer to my problem

here is the function that is charged to print the data to the python console

def readData(serial):
       b = serial.read(1)
       print(b)
       readData(serial)

Thanks

0 Answers0