Package pymata_aio :: Module pin_data
[hide private]
[frames] | no frames]

Source Code for Module pymata_aio.pin_data

 1  """ 
 2  Copyright (c) 20115 Alan Yorinks All rights reserved. 
 3   
 4  This program is free software; you can redistribute it and/or 
 5  modify it under the terms of the GNU  General Public 
 6  License as published by the Free Software Foundation; either 
 7  version 3 of the License, or (at your option) any later version. 
 8   
 9  This library is distributed in the hope that it will be useful, 
10  but WITHOUT ANY WARRANTY; without even the implied warranty of 
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12  General Public License for more details. 
13   
14  You should have received a copy of the GNU General Public 
15  License along with this library; if not, write to the Free Software 
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
17  """ 
18 19 20 -class PinData:
21 """ 22 Each analog and digital input pin is described by an instance of this class. It contains both 23 the last data value received and a potential callback reference. 24 """ 25
26 - def __init__(self):
27 # current data value 28 self._current_value = 0 29 # callback reference 30 self._cb = None
31 32 @property
33 - def current_value(self):
34 return self._current_value
35 36 @current_value.setter
37 - def current_value(self, value):
38 self._current_value = value
39 40 @property
41 - def cb(self):
42 return self._cb
43 44 @cb.setter
45 - def cb(self, value):
46 self._cb = value
47