Hello together
I have a problem to connect the Pa.HUB to my CORE2
I try to do a weatherstation, were I have to read from different sensor's
I have to use "ENVII", "EXT.I/O" and "ADC" sensors. I try to use the Pa.HUB as connector.
The Pa.HUB is connectet to the PortA (Red)
Always when I try to uploade the programm, there is the fail: "name 'freq' isn't defined"
When I connect the ENVII directly to PortA, since V1.7.2 it works. But i need to read more sensors.
I use the M5 CORE2, with PaHUB
I use the V1.7.2 on my M5 and did burn them with M5Burner.
I use the V1.7.2 UiFLOW Beta (The other version do not support the M5 Core2)
The sending/uploding from the progrogrammcode to the M5 over the Internet work's well with other codes, the country is switzerland.
codeexample:
~~
from m5stack import *
from m5stack_ui import *
from uiflow import *
import time
import unit
screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xFFFFFF)
pahub1 = unit.get(unit.PAHUB, unit.PORTA)
env21 = unit.get(unit.ENV2, unit.PAHUB0)
ext_io1 = unit.get(unit.EXT_IO, unit.PAHUB1)
adc0 = unit.get(unit.ADC, unit.PAHUB2)
text_header = M5Label('Wetterstation Transferprojekt', x=15, y=10, color=0x000, font=FONT_MONT_26, parent=None)
text2_humi = M5Label('Luftfeuchtigkeit:', x=15, y=75, color=0x000, font=FONT_MONT_18, parent=None)
text1_temp = M5Label('Temparatur:', x=15, y=50, color=0x000, font=FONT_MONT_18, parent=None)
text3_pres = M5Label('Luftdruck:', x=15, y=100, color=0x000, font=FONT_MONT_18, parent=None)
text3_windspeed = M5Label('Windgeschwindigkeit:', x=15, y=125, color=0x000, font=FONT_MONT_18, parent=None)
text5_winddir = M5Label('Windrichtung:', x=15, y=150, color=0x000, font=FONT_MONT_18, parent=None)
text6_rain = M5Label('Regen:', x=15, y=175, color=0x000, font=FONT_MONT_18, parent=None)
val_temp = M5Label('N/A', x=200, y=50, color=0x000, font=FONT_MONT_18, parent=None)
val_humi = M5Label('N/A', x=200, y=75, color=0x000, font=FONT_MONT_18, parent=None)
val_pres = M5Label('N/A', x=200, y=100, color=0x000, font=FONT_MONT_18, parent=None)
val_windspeed = M5Label('N/A', x=200, y=125, color=0x000, font=FONT_MONT_18, parent=None)
val_winddir = M5Label('N/A', x=200, y=150, color=0x000, font=FONT_MONT_18, parent=None)
val_rain = M5Label('N/A', x=200, y=175, color=0x000, font=FONT_MONT_18, parent=None)
while True:
val_temp.set_text(str(env21.temperature))
val_humi.set_text(str(env21.humidity))
val_pres.set_text(str(env21.pressure))
val_windspeed.set_text(str(ext_io1.digitRead(0)))
val_winddir.set_text(str(adc0.voltage))
wait(2)
wait_ms(2)~~
Error Detail
~~
File "<string>", line 11, in <module>
File "unit.py", line 130, in get
File "<string>", line 1, in <module>
File "<units/_env2.py>", line 7, in init
File "<i2c_bus.py", line 183, in init
File "<i2c_bus.py", line 40, in init
File "<i2c_bus.py", line 32, in get
File "<i2c_bus.py", line 130, in init
NameError: name 'freq' isn't defined
~~
Hope for a solution
Thx Matthias