Metadata-Version: 1.1
Name: raspihats
Version: 1.1.0
Summary: package for controlling raspihats.com boards
Home-page: https://github.com/raspihats/raspihats
Author: Florin Costa
Author-email: hardhat@raspihats.com
License: The MIT License (MIT)

Copyright (c) 2016 raspihats

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Description: raspihats package
        =================
        
        This package provides the necessary code to interface the Raspberry Pi HATs(add-on boards) from raspihats.com_: 
        
        
        Typical usage often looks like this:
        
        .. code-block:: python
        
            #!/usr/bin/env python
            # In this setup there are two I2C-HATs stacked, one Di16 and one Rly10.
            from raspihats.i2c_hats import Di16, Rly10
            
            di16 = Di16(0x40)   # 0x40 is the I2C bus address
            rly10 = Rly10(0x50) # 0x50 is the I2C bus address
            # The I2C-HAT address high nibble is fixed(0x4 for Di16, 0x5 for Rly10), the low nibble
            # value is set using the on-board address jumper, range is [0x0 .. 0xF].
            
            while True:
                state = di16.di_get_channel_state('Di1.1')
                rly10.do_set_channel_state('Rly1', state)
                rly10.do_set_channel_state('Rly2', not state)
        
        Note
        -----
        
        Every **I2CHat** object is practically a thread, this thread is used to feed the I2C-HAT communication watchdog(CWDT). Failing to feed the CWDT will result in a CWDT timeout which depending on the I2CHat type can have different consequences.
        **By default the CWDT is disabled and the feed thread is not started, advanced users can enable both using the cwdt_start_feed_thread() method.**
        
        Installation
        ------------
        
        Install dependencies
        ~~~~~~~~~~~~~~~~~~~~
        
        The python-smbus package
        
        .. code-block:: console
        
            $ sudo apt-get install python-smbus
            # or if using python 3
            $ sudo apt-get install python3-smbus
        
        
        Install from repository
        ~~~~~~~~~~~~~~~~~~~~~~~
        
        .. code-block:: console
        
            # Make sure you have git, pip and setuptools installed
            $ git clone git@github.com:raspihats/raspihats.git
            $ cd raspihats
            $ sudo python setup.py install
            # or if using python 3
            $ sudo python3 setup.py install
        
        
        Install using pip
        ~~~~~~~~~~~~~~~~~~~~~~
        
        .. code-block:: console
        
            # Make sure you have pip and setuptools installed
            $ sudo pip install raspihats
            # or if using python 3
            $ sudo pip3 install raspihats
        
        
        Checkout raspihats.com_
        
        
        .. _raspihats.com: http://www.raspihats.com
Keywords: Raspberry Pi hats add-on boards
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Operating System :: POSIX :: Linux
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development
Classifier: Topic :: Home Automation
Classifier: Topic :: System :: Hardware
