You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dynamicSerial:- Returns a list with only one element
dynamicSerial is similar to dynamic mode of ardata() except that this returns a list with just one element in it.
dynamicSerial( COM , baudrate = 9600 , timeout = 1 , msg = "a" , dynamicDelay = 0.5 ) is the function header.
Parameters
Usage
COM
Specify the COM port. Similar to ardata(), you can pass either an integer or the complete name as a string.
baudrate =9600
Set the baudrate. Default value is 9600.
timeout =1
Set the timeout. Default is 1
msg ="a"
String to be written to the Serial Port
dynamicDelay = 0.5
Similar to that of ardata's dynamicDelay. Default value is set to 0.5 seconds. Any value lesser than this would result in overlapping of the input.
This function returns a list with only one element.
Note:
For an arduino program that prints a value on Serial monitor only when we send it a value, the combination of writeSerial and readSerial functions won't work. dynamicSerial has to be used at that place.
# UsedynamicSerial(8,msg="Give DATA")
# INSTEAD OFwriteSerial(8,msg="Give Data")
data=readSerial(8)
# The latter would only return an empty list !!!