irrad_control/irrad_server.py
def _setup_adc(self):
        """Setup the ADS1256 instance and channels"""

        # Instance of ADS1256 ADC on WaveShare board
        self.adc = ADS1256()

        # Set initial data rate from DAQ setup
        self.adc.drate = ads1256_drates[self.adc_setup['sampling_rate']]

        # Calibrate the ADC before DAQ
        self.adc.cal_self()

        # Declare all available channels of the ADS1256
        self._pos_channels = (POS_AIN0, POS_AIN1, POS_AIN2, POS_AIN3, POS_AIN4, POS_AIN5, POS_AIN6, POS_AIN7)
        self._gnd = NEG_AINCOM
        self.adc_channels = []

        # Assign the physical channel numbers e.g. multiplexer address
        for ch in self.adc_setup['ch_numbers']:
            # Single-ended versus common ground self._gnd
            if isinstance(ch, int):
                tmp_ch = self._pos_channels[ch] | self._gnd
            # Differential measurement
            else:
                a, b = ch
                tmp_ch = self._pos_channels[a] | self._pos_channels[b]
            # Add to channels
            self.adc_channels.append(tmp_ch)
Setup the ADS1256 instance and channels
Setup the ADS1256 instance and channels
Setup the ADS1256 instance and channels
def _setup_adc(self):
        self.adc = ADS1256()
        self.adc.drate = ads1256_drates[self.adc_setup['sampling_rate']]
        self.adc.cal_self()
        self._pos_channels = (POS_AIN0, POS_AIN1, POS_AIN2, POS_AIN3, POS_AIN4, POS_AIN5, POS_AIN6, POS_AIN7)
        self._gnd = NEG_AINCOM
        self.adc_channels = []
        for ch in self.adc_setup['ch_numbers']:
            if isinstance(ch, int):
                tmp_ch = self._pos_channels[ch] | self._gnd
            else:
                a, b = ch
                tmp_ch = self._pos_channels[a] | self._pos_channels[b]
            self.adc_channels.append(tmp_ch)
def _setup_adc ( self ) : self . adc = ADS1256 ( ) self . adc . drate = ads1256_drates [ self . adc_setup [ 'sampling_rate' ] ] self . adc . cal_self ( ) self . _pos_channels = ( POS_AIN0 , POS_AIN1 , POS_AIN2 , POS_AIN3 , POS_AIN4 , POS_AIN5 , POS_AIN6 , POS_AIN7 ) self . _gnd = NEG_AINCOM self . adc_channels = [ ] for ch in self . adc_setup [ 'ch_numbers' ] : if isinstance ( ch , int ) : tmp_ch = self . _pos_channels [ ch ] | self . _gnd else : a , b = ch tmp_ch = self . _pos_channels [ a ] | self . _pos_channels [ b ] self . adc_channels . append ( tmp_ch )
Setup the ADS1256 instance and channels
Setup the ADS1256 instance and channels
"""Setup the ADS1256 instance and channels""" # Instance of ADS1256 ADC on WaveShare board # Set initial data rate from DAQ setup # Calibrate the ADC before DAQ # Declare all available channels of the ADS1256 # Assign the physical channel numbers e.g. multiplexer address # Single-ended versus common ground self._gnd # Differential measurement # Add to channels
self