Trying to get stick V working
-
I am trying to get the Stick V working.
I flashed it with the firmware 1.2 of target trace.
I am using this code wit UIFlow Beta:
from m5stack import *
from m5ui import *
from uiflow import *
import unitsetScreenColor(0x222222)
rectangle0 = M5Rect(134, 104, 30, 30, 0xFFFFFF, 0xFFFFFF)
Follow = M5Title(title="Title", x=3 , fgcolor=0xFFFFFF, bgcolor=0x0000FF)
label0 = M5TextBox(5, 30, "Text", lcd.FONT_Default,0xFFFFFF, rotate=0)
label1 = M5TextBox(70, 30, "Text", lcd.FONT_Default,0xFFFFFF, rotate=0)x = None
y = None
h = None
w = Nonedef buttonA_wasPressed():
global x, y, h, w
V0.setTrackAreaCoordinate(140, 100, 40, 40)
pass
btnA.wasPressed(buttonA_wasPressed)Follow.setTitle('Follow the rabbit')
V0 = unit.get(unit.TARGET_TRACE, unit.PORTB)
while True:
x = V0.getTrack_X()
y = V0.getTrack_Y()
h = V0.getTrack_Height()
w = V0.getTrack_Width()
label0.setText(str(x))
label1.setText(str(y))
rectangle0.setPosition(x, y)
rectangle0.setSize(h, w)
wait_ms(2)And getting the following error-Message:
'module' object has no attribute 'TARGET_TRACE'
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