Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 20046

Re: Galileo linux connecting to serial on /dev/ttyS0 questions

$
0
0

Well the commands ser = serial.Serial(“/dev/ttyS0,57600) and ser = serial.Serial(“/dev/ttyGS0”, 9600) are used to initialize the ports. The ttyS0 is the pin 0 and 1 used as serial port and the GS0 is the USB client, in case you want to use both, you’ll have to change the name one the variables from “ser” to another name, because if you use the code like you posted, you would use as ser the USB client not the serial port. Also remember to change the speeds depending on the speed the sensor sends the data, for example for the ttyS0 maybe your sensor sends data at 9600 bauds you just have to change the 57600 for 9600. To read a line of data you can use line = ser.readline(). I recommend you to check this post in there is an introduction to pyserial. http://pyserial.sourceforge.net/shortintro.html it might be useful.

Regards
JPMontero_Intel


Viewing all articles
Browse latest Browse all 20046

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>