Button on CoreS3 not working
-
Using UiFlow2 alpha-17
I have a button on CoreS3 on black port B
I try to retrieve its value
I get an error hardware/button.py line 25 in isHolding
AttributeError 'super' object has no attribute 'last_state'Here's the code
import os, sys, io
import M5
from M5 import *
from unit import *title0 = None
label0 = None
dual_button_0_blue = None
dual_button_0_red = NoneisHold = None
def setup():
global title0, label0, dual_button_0_blue, dual_button_0_red, isHolddual_button_0_blue, dual_button_0_red = DualButton((8, 9))
M5.begin()
Widgets.fillScreen(0x222222)
Widgets.fillScreen(0x222222)
title0 = Widgets.Title("Title", 3, 0xFFFFFF, 0x0000FF, Widgets.FONTS.DejaVu18)
label0 = Widgets.Label("Text", 20, 76, 1.0, 0xffffff, 0x222222, Widgets.FONTS.DejaVu18)title0.setText('Main')
isHold = 0def loop():
global title0, label0, dual_button_0_blue, dual_button_0_red, isHold
M5.update()
isHold = dual_button_0_blue.isHolding()
label0.setText(str((str(isHold))))if name == 'main':
try:
setup()
while True:
loop()
except (Exception, KeyboardInterrupt) as e:
try:
from utility import print_error_msg
print_error_msg(e)
except ImportError:
print("please update to latest firmware")
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login