Module GenericAnalogSensor
|
|
1
2
3 '''
4 This software is part of the EV3BrickPi library.
5 It is Open Source Free Software, so you may
6 - run the code for any purpose
7 - study how the code works and adapt it to your needs
8 - integrate all or parts of the code in your own programs
9 - redistribute copies of the code
10 - improve the code and release your improvements to the public
11 However the use of the code is entirely your responsibility.
12 '''
13
14 from LegoRobot import LegoRobot
15
17 '''
18 Creates an abstraction of a generic analog sensor attached at given port.
19 '''
25
27 '''
28 Returns the current value.
29 '''
30 LegoRobot._lock.acquire()
31 value = BrickPi.Sensor[self.port]
32 LegoRobot._lock.release()
33 return value
34