Go to advanced search

by BatIgor
Sat Jan 04, 2014 4:13 pm
Forum: Python
Topic: Certain negative temperatures don't register - need help!
Replies: 7
Views: 1487

Re: Certain negative temperatures don't register - need help

Thanks, everyone, Especially Douglas6 for the code! Here is the fixed part of the code by the way: if status=="YES": print status m = re.match('.*t=(-?[0-9\.]+)', lines[1]) tempstr= m.group(1) print tempstr tempvalue=float(tempstr)/1000 print tempvalue return tempvalue
by BatIgor
Fri Jan 03, 2014 5:28 pm
Forum: Python
Topic: Certain negative temperatures don't register - need help!
Replies: 7
Views: 1487

Re: Certain negative temperatures don't register - need help

It just gives 12937 on print tempstr while the actual temperature is -12,937
The whole file it reads is:

Code: Select all

31 ff 4b 46 7f ff 0f 10 24 : crc=24 YES
31 ff 4b 46 7f ff 0f 10 24 t=-12937
by BatIgor
Fri Jan 03, 2014 3:23 pm
Forum: Python
Topic: Certain negative temperatures don't register - need help!
Replies: 7
Views: 1487

Certain negative temperatures don't register - need help!

Hi, I'm trying to follow this tutorial: http://raspberrywebserver.com/cgiscripting/rpi-temperature-logger/building-an-sqlite-temperature-logger.html However, there is a problem: whenever a temperature goes below -10 degrees the minus disappears and it looks like if it it's a positive temperature. ht...

Go to advanced search