I am trying to install a Python script which requires that many orders be sent to my Arduino individually, Read all and the output It makes me have an Ardino script, which responds to simple string commands (like MA3 etc.), either with OK, ERR or a value (if I'm installing Ardino or Board Depends on measuring the component connected).
For example:
ser = serial.Serial ("COM6", 115200) ser.write ('SA 50000') ser.write ('SM 0' ) Ser.write ('SI 0') ser.write ('SF500') ser.write ('MA3') while true: print ser.readline ()
I want to set this code (first 4 write statements) to start the parameters, start up (last write) and then print until anything else is coming from the component. I know that the statement does not stop at any point, but this is not my problem. My problem is that the script will not send the same way my parameter is written as long as I am at that time I will not put in, so that Arduino can start the parameter every time.
Can anyone help me? I am quite new to the complete picarial and I am talking to Ardunes. My Arduino script works (I have tested it in Arduino monitor and if I put my statement in the loop, it prints them).
No comments:
Post a Comment