Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the twentyfifteen domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/sunapi386.ca/wordpress/wp-includes/functions.php on line 6121
pyserial – sunapi386's Blog

Python Tutorial to serial programming

Python Tutorial

Edit Jan 29 2013: This site has gained some significant traffic, according to google. If you search “pyserial tutorial” this page is 3rd up. So hence I will edit and make it a bit more understandable, seems like there is actually a need for this!

This tutorial describes the process of connecting to a spectrometer over serial port, and writing a python program to automate collection of data. Normally we would need to enter in the wavelength and acquire the (transmittance/absorbency/concentration) result manually. Since the spectrometer has a serial port, we can write a program that automates this process. In order for python to be able to talk to the spectrometer, we need to get pySerial, which extends Python’s capabilities to include interacting with a serial port.

In this python tutorial, I will explain how to:

  1. How to configure Python and pySerial
  2. Verify serial port communication, with a spectrometer device
  3. Write some functioning code in Python and use the spectrometer

Continue reading Python Tutorial to serial programming