From 0e976e66ffb5a5408b03b9d15ae07faebf987ac6 Mon Sep 17 00:00:00 2001 From: wavicles Date: Mon, 22 Aug 2016 08:01:32 +0530 Subject: [PATCH 1/3] minor change --- PSL/sciencelab.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/PSL/sciencelab.py b/PSL/sciencelab.py index 8c64d4cc..26407ff1 100644 --- a/PSL/sciencelab.py +++ b/PSL/sciencelab.py @@ -33,7 +33,7 @@ class ScienceLab(): """ **Communications library.** - This class contains methods that can be used to interact with the FOSSASIA PSLab + This class contains methods that can be used to interact with the PSLab Initialization does the following @@ -54,7 +54,7 @@ class ScienceLab(): - Once you have initiated this class, its various methods will allow access to all the features built + Once you have instantiated this class, its various methods will allow access to all the features built into the device. @@ -127,7 +127,7 @@ def __runInitSequence__(self,**kwargs): self.achans=[analogAcquisitionChannel(a) for a in ['CH1','CH2','CH3','MIC']] self.gain_values=gains self.buff=np.zeros(10000) - self.SOCKET_CAPACITANCE = 42e-12# 42e-12 is typical for the FOSSASIA PSLab. Actual values will be updated during calibration loading + self.SOCKET_CAPACITANCE = 42e-12# 42e-12 is typical for the PSLab. Actual values will be updated during calibration loading self.resistanceScaling = 1. self.digital_channel_names=digital_channel_names @@ -211,7 +211,6 @@ def __runInitSequence__(self,**kwargs): self.__print__( b,poly) self.aboutArray.append([b]+['%.3e'%v for v in poly]) polyDict[a[:3]].append(poly) - #Load calibration data (slopes and offsets) for ADC channels inl_slope_intercept=struct.unpack('2f',inl_slope_intercept) @@ -367,7 +366,7 @@ def capture1(self,ch,ns,tg,*args,**kwargs): tg Timegap between samples in microseconds ============== ============================================================================================ - .. figure:: ../images/capture1.png + .. figure:: images/capture1.png :width: 11cm :align: center :alt: alternate text @@ -404,7 +403,7 @@ def capture2(self,ns,tg,TraceOneRemap='CH1'): TraceOneRemap Choose the analog input for channel 1. It is connected to CH1 by default. Channel 2 always reads CH2. ============== ======================================================================================================= - .. figure:: ../images/capture2.png + .. figure:: images/capture2.png :width: 11cm :align: center :alt: alternate text @@ -457,7 +456,7 @@ def capture4(self,ns,tg,TraceOneRemap='CH1'): TraceOneRemap Choose the analog input for channel 1. It is connected to CH1 by default. Channel 2 always reads CH2. ============== ====================================================================================================== - .. figure:: ../images/capture4.png + .. figure:: images/capture4.png :width: 11cm :align: center :alt: alternate text @@ -763,7 +762,7 @@ def capture_traces(self,num,samples,tg,channel_one_input='CH1',CH123SA=0,**kwarg .. _adc_example: - .. figure:: ../images/transient.png + .. figure:: images/transient.png :width: 11cm :align: center :alt: alternate text @@ -2584,6 +2583,7 @@ def capacitance_via_RC_discharge(self): RC = self.__capture_capacitance__(samples,int(T/samples))[3][1] return RC/10e3 else: + self.__print__('cap out of range %f %f'%(T,cap)) return 0 except Exception as e: self.__print__(e) @@ -3872,6 +3872,7 @@ def servo4(self,a1,a2,a3,a4): """ Operate Four servo motors independently using SQR1, SQR2, SQR3, SQR4. tested with SG-90 9G servos. + For high current servos, please use a different power source, and a level convertor for the PWm output signals(if needed) .. tabularcolumns:: |p{3cm}|p{11cm}| @@ -3971,6 +3972,7 @@ def estimateDistance(self): except Exception as ex: self.raiseException(ex, "Communication Error , Function : "+inspect.currentframe().f_code.co_name) + """ def TemperatureAndHumidity(self): ''' init AM2302. @@ -3984,6 +3986,7 @@ def TemperatureAndHumidity(self): except Exception as ex: self.raiseException(ex, "Communication Error , Function : "+inspect.currentframe().f_code.co_name) self.digital_channels_in_buffer=1 + """ def opticalArray(self,SS,delay,channel = 'CH3',**kwargs): ''' @@ -4081,5 +4084,5 @@ def raiseException(self,ex, msg): I.get_average_voltage('CH1') """) #I=connect(verbose = True) - #print (I.get_capacitance()) + #for a in range(20):print (I.get_capacitance()) #I=connect(verbose=True,load_calibration=False) From f930d1bef915d0857d18c7a41f97a649a1381a5d Mon Sep 17 00:00:00 2001 From: "Praveen (Gnovi)" Date: Mon, 22 Aug 2016 08:07:32 +0530 Subject: [PATCH 2/3] Update sciencelab.py --- PSL/sciencelab.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PSL/sciencelab.py b/PSL/sciencelab.py index 26407ff1..cb4b704f 100644 --- a/PSL/sciencelab.py +++ b/PSL/sciencelab.py @@ -33,7 +33,7 @@ class ScienceLab(): """ **Communications library.** - This class contains methods that can be used to interact with the PSLab + This class contains methods that can be used to interact with the FOSSASIA PSLab Initialization does the following @@ -54,7 +54,7 @@ class ScienceLab(): - Once you have instantiated this class, its various methods will allow access to all the features built + Once you have initiated this class, its various methods will allow access to all the features built into the device. From 3ab5dd56f84bec0aa0a1bb530506bc1b16bd1b67 Mon Sep 17 00:00:00 2001 From: "Praveen (Gnovi)" Date: Mon, 22 Aug 2016 08:10:02 +0530 Subject: [PATCH 3/3] Update sciencelab.py --- PSL/sciencelab.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PSL/sciencelab.py b/PSL/sciencelab.py index cb4b704f..1202eced 100644 --- a/PSL/sciencelab.py +++ b/PSL/sciencelab.py @@ -127,7 +127,7 @@ def __runInitSequence__(self,**kwargs): self.achans=[analogAcquisitionChannel(a) for a in ['CH1','CH2','CH3','MIC']] self.gain_values=gains self.buff=np.zeros(10000) - self.SOCKET_CAPACITANCE = 42e-12# 42e-12 is typical for the PSLab. Actual values will be updated during calibration loading + self.SOCKET_CAPACITANCE = 42e-12# 42e-12 is typical for the FOSSASIA PSLab. Actual values will be updated during calibration loading self.resistanceScaling = 1. self.digital_channel_names=digital_channel_names