ronda00
Posts: 1
Joined: Wed Nov 18, 2015 2:52 pm

read MLX90614

Sun Nov 22, 2015 6:16 pm

hi
please,

to see if together we can make all options expanded reading this sensor code.

Encouragement and thanks

Code: Select all


# para que funcione el I2C tengo que ejecutar desde
# la linea de comandos
# echo -n 1 > /sys/module/i2c_bcm2708/parameters/combined exit

import smbus
addr = 0x5a
x = 0x07
i2c = smbus.SMBus(1)
lreg = i2c.read_word_data(addr, x)
print "%02x: %02x %d"%(x,lreg,lreg)
#print ret
t = "%02x"%(lreg)
tb = int(t, 16)
#print "t:",t
#print "tb = int(t,16).. convertimos hex a dec .->", tb
tb = tb * 0.02
#print "si el registo 0000 es 273.15 grados lo multiplico x 0,02"
#print "tb = tb * 0.02 .-> ", tb 
temp = tb - 273.15
#print "temp = tb -273.15 lo paso a centigrados", temp, "C"
print "T.-> ", temp

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: read MLX90614

Mon Nov 23, 2015 2:33 pm

Would need some more explanation of what you are after... If the language is an issue, might want to look at these subforums: viewforum.php?f=90 (I cannot tell if that is Spanish or Portuguese)
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

Return to “Python”