Changes

Jump to navigation Jump to search
69 bytes added ,  14:00, 20 January 2016
no edit summary
Line 18: Line 18:     
== Code example ==
 
== Code example ==
You can read temperature and humidity values with any software that connects to a serial port. Most conveniently you can use the [https://pypi.python.org/pypi/RuSocSci RuSocSci] library in python.  Here is a little example how to write a script that reads the temperature and humidity and writes it to the standard output (console):<code>
+
You can read temperature and humidity values with any software that connects to a serial port. Most conveniently you can use the [https://pypi.python.org/pypi/RuSocSci RuSocSci] library in python.  Here is a little example how to write a script that reads the temperature and humidity and writes it to the standard output (console):
 +
<syntaxhighlight lang="text">
 
  #!/usr/bin/env python
 
  #!/usr/bin/env python
 
  # -*- coding: utf-8 -*-
 
  # -*- coding: utf-8 -*-
Line 24: Line 25:  
  th = temperaturehumidity.TemperatureHumidity()
 
  th = temperaturehumidity.TemperatureHumidity()
 
  print(th.waitString())
 
  print(th.waitString())
</code>
+
</syntaxhighlight>
    
== Potential problems ==
 
== Potential problems ==
 
The temperaturehumidity device identifies as a bttonbox. Lab computer are set up in a way that makes the second buttonbox behave different from all other devices. If you are using both the buttonbox and the temperaturehumidity device, please look up the portname of the temperaturehumidity device in the windows device manager and if it is for instance 'COM3' then change the code above into:
 
The temperaturehumidity device identifies as a bttonbox. Lab computer are set up in a way that makes the second buttonbox behave different from all other devices. If you are using both the buttonbox and the temperaturehumidity device, please look up the portname of the temperaturehumidity device in the windows device manager and if it is for instance 'COM3' then change the code above into:
<code>
+
<syntaxhighlight lang="text">
 
  #!/usr/bin/env python
 
  #!/usr/bin/env python
 
  # -*- coding: utf-8 -*-
 
  # -*- coding: utf-8 -*-
Line 34: Line 35:  
  th = temperaturehumidity.TemperatureHumidity(port='COM3')
 
  th = temperaturehumidity.TemperatureHumidity(port='COM3')
 
  print(th.waitString())
 
  print(th.waitString())
</code>
+
</syntaxhighlight>

Navigation menu