#NEWLINE# def set( self , value ) : #NEWLINE# #INDENT# ' Set the DAC control register to the given value. ' #NEWLINE# if ( value > value . max_value ) : #NEWLINE# #INDENT# value = self . max_value #NEWLINE# #UNINDENT# if ( value < 0 ) : #NEWLINE# #INDENT# value = 0 #NEWLINE# #UNINDENT# value <<= self . bit_shift #NEWLINE# digitalWrite ( self . _sync , LOW ) #NEWLINE# shiftOut ( self . _data , self . _clk , MSBFIRST , ( value >> 8 ) , FALLING ) #NEWLINE# shiftOut ( self . _data , self . _clk , MSBFIRST , ( value & 255 ) , FALLING ) #NEWLINE# digitalWrite ( self . _sync , HIGH )