#NEWLINE# def Temperature( self ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# bus . write_byte ( self . I2C_ADDR , 0 ) #NEWLINE# time . sleep ( 0.2 ) #NEWLINE# d = ( [ 0 ] * 2 ) #NEWLINE# d [ 0 ] = bus . read_byte ( self . I2C_ADDR ) #NEWLINE# time . sleep ( 0.001 ) #NEWLINE# d [ 1 ] = bus . read_byte ( self . I2C_ADDR ) #NEWLINE# time . sleep ( 0.001 ) #NEWLINE# raw = ( ( d [ 0 ] << 8 ) | d [ 1 ] ) #NEWLINE# return ( ( ( float ( raw ) / 65536.0 ) * 165.0 ) - 40.0 ) #NEWLINE# #UNINDENT# except IOError as err : #NEWLINE# #INDENT# print ( 'No ACK!' ) #NEWLINE# time . sleep ( 0.1 ) #NEWLINE# self . Temperature ( )