This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automation pHat as a Voltmeter?
#2
I ordered the automation phat, and I am now trying to figure out, how to implement it in OP.

The automation phat is connected via I2C and after installing a library, the battery is connected to the analog input. It measures up to 24V directly.

The voltage is shown as follows:

value = automationhat.analog.one.read()

How could the voltage data be shown in OP? The aim is to send it via MQTT.

Martin

Edit: Just found a python example, but I need it simpler :-)

#!/usr/bin/env python




import time




import automationhat

time.sleep(0.1) # short pause after ads1015 class creation recommended







print("""

Press CTRL+C to exit.

""")




while True:

   value = automationhat.analog.one.read()

   print(value)

   time.sleep(0.25)
Reply


Messages In This Thread
Automation pHat as a Voltmeter? - by Alpenskipper - 2017-09-09, 10:01 PM
RE: Automation pHat as a Voltmeter? - by Alpenskipper - 2017-09-12, 09:02 AM
RE: Automation pHat as a Voltmeter? - by PaddyB - 2017-09-12, 10:24 AM
Automation pHat as a Voltmeter? - by Alpenskipper - 2017-09-12, 10:34 AM
RE: Automation pHat as a Voltmeter? - by Luckbert - 2017-09-12, 12:44 PM
Automation pHat as a Voltmeter? - by Alpenskipper - 2017-09-12, 01:26 PM
RE: Automation pHat as a Voltmeter? - by PaddyB - 2017-09-12, 04:13 PM
RE: Automation pHat as a Voltmeter? - by PaddyB - 2017-09-13, 09:05 AM
RE: Automation pHat as a Voltmeter? - by PaddyB - 2017-09-13, 08:39 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)