Skip to content

Instantly share code, notes, and snippets.

@mhubig
Created August 16, 2011 12:34
Show Gist options
  • Save mhubig/1148966 to your computer and use it in GitHub Desktop.
Save mhubig/1148966 to your computer and use it in GitHub Desktop.
test.py
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Copyright (C) 2011, Markus Hubig <[email protected]>
This file is part of IMPLib2 a small Python library implementing
the IMPBUS-2 data transmission protocol.
IMPLib2 is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
IMPLib2 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with IMPLib2. If not, see <http://www.gnu.org/licenses/>.
"""
import time
from bus_interface import IMPBus, IMPBusException
from module_interface import Module, ModuleException
bus = IMPBus(port='/dev/tty.usbserial-A700eQFp')
bus.open_device()
bus.synchronise_bus()
modlist = bus.scan_bus()
while True:
for module in modlist:
print "SerialNumber:", module._serno
print "Temperatur:", module.get_temp()
print "Feuchte:", module.get_moist()
print
time.sleeep(600) # 600 sec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment