Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining more than one radio button on the page #22

Open
vahithosan opened this issue Oct 28, 2022 · 0 comments
Open

Defining more than one radio button on the page #22

vahithosan opened this issue Oct 28, 2022 · 0 comments

Comments

@vahithosan
Copy link

Hi. I get an error when I want to define more than one radio button on the page.

import uasyncio as asyncio
from machine import UART
import time
from lib.nextion import NexHardware, NexPage, NexNumber, NexText, NexDSButton, NexButton, NexRadio

uart = UART(2, baudrate=9600, tx=21, rx=22)
uart.init(baudrate=9600, bits=8, parity=None, stop=1)

tx_pin = 21
rx_pin = 22

# # create Nextion hardware interface
nh = NexHardware(rx_pin=rx_pin, tx_pin=tx_pin)
nh.nexInit()


page10 = NexPage(nh, 10 ,0, "page10")
page11 = NexPage(nh, 11 ,0, "page11")
page12 = NexPage(nh, 12 ,0, "page12")

#Page10
p10n12=NexNumber(nh, 10, 8, "page10.n12")
#Page11
p11n13=NexNumber(nh, 11, 8, "page11.n13")
#Page12
p12r0=NexRadio(nh, 12, 6, "page12.r0")
p12r1=NexRadio(nh, 12, 7, "page12.r1")


p12r0.getValue()
p12r1.getValue()

define the first radio button

>>> p12r0=NexRadio(nh, 12, 6, "page12.r0")

I get an error when I define the second radio button.

>>> p12r1=NexRadio(nh, 12, 7, "page12.r1")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "lib/nextion/nextion_radio.py", line 43, in __init__
AttributeError: 'type' object has no attribute 'getFont'
>>> 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant