Python Forum
Mathematical Conversion Scripts for Weather Station
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mathematical Conversion Scripts for Weather Station
#4
 	if (config.BMP280_Present):
		bmpTemp = bmp280.read_temperature()
		TempF = bmpTemp* (9.0/5.0) +32.0
		print 'Temperature = \t{0:0.2f} F'.format(TempF)
		#print 'Temperature = \t{0:0.2f} C'.format(bmp280.read_temperature())
		print 'Pressure = \t{0:0.2f} KPa'.format(bmp280.read_pressure()/1000)
		print 'Altitude = \t{0:0.2f} m'.format(bmp280.read_altitude())
		print 'Sealevel Pressure = \t{0:0.2f} KPa'.format(bmp280.read_sealevel_pressure()/1000)
		if (config.OLED_Present):
			Scroll_SSD1306.addLineOLED(display, 'Press= \t{0:0.2f} KPa'.format(bmp280.read_pressure()/1000))
			if (config.HTU21DF_Present == False):
				Scroll_SSD1306.addLineOLED(display, 'InTemp= \t{0:0.2f} C'.format(bmp280.read_temperature()))
	print "----------------- "

	print "----------------- "
	if (config.HTU21DF_Present == True):
		print " HTU21DF Temp/Hum"
	else:
		print " HTU21DF Temp/Hum Not Present"
	print "---------------- 
I guess that the other conversion text will used the same coding, just reference different formulas.
Reply


Messages In This Thread
RE: Mathematical Conversion Scripts for Weather Station - by Mickey53usa - Jun-16-2020, 09:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  plotting based on the results of mathematical formulas Timur 1 366 Feb-08-2024, 07:22 PM
Last Post: Gribouillis
  Taking Mathematical Expressions from Strings quest 2 722 Jul-02-2023, 01:38 PM
Last Post: Pedroski55
  Copying files from a remote Windows station tester_V 11 6,935 Jul-17-2021, 02:19 AM
Last Post: tester_V
  About mathematical equations seyidcemkarakas 3 2,085 Oct-04-2020, 01:21 PM
Last Post: Gribouillis
  Recognising mathematical expressions from word and pdf file Preeti15 0 1,809 Aug-19-2020, 09:06 AM
Last Post: Preeti15
  Parsing Date/Time from Metar Reports with 6 hourly weather information Lawrence 0 2,367 May-03-2020, 08:15 PM
Last Post: Lawrence
  Mathematical Operators in String AgileAVS 1 2,410 Mar-04-2020, 04:14 PM
Last Post: Gribouillis
  Mathematical function input Tiiill 2 2,744 Sep-10-2019, 09:25 PM
Last Post: nilamo
  Beginner user: mathematical operations Mahdi1994 1 2,866 Mar-19-2018, 11:07 AM
Last Post: Larz60+
  how to make a mathematical operation without the command "print" ewar2606 4 2,985 Mar-15-2018, 07:19 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020