Skip to content

minitft_featherwing buttons always true when power source not PC #40

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

Closed
hexthat opened this issue Apr 13, 2019 · 13 comments
Closed

minitft_featherwing buttons always true when power source not PC #40

hexthat opened this issue Apr 13, 2019 · 13 comments
Assignees

Comments

@hexthat
Copy link
Contributor

hexthat commented Apr 13, 2019

"""
featherM4 & mini TFT joypad featherwing tester
"""
import board
import neopixel
import terminalio
import time
from adafruit_featherwing import minitft_featherwing
from adafruit_display_text import label
import gc

pixel = neopixel.NeoPixel(board.NEOPIXEL, 1)
pixel[0] = (0, 0, 0)
gc.collect()
print(gc.mem_free())

wing = minitft_featherwing.MiniTFTFeatherWing()

def getbuttons():
    print(wing.buttons)  # added just to see what is going on
    buttons = wing.buttons
    if buttons.right:
        RIGHTtext = "RIGHT "
    else:
        RIGHTtext = ""

    if buttons.down:
        DOWNtext = "DOWN "
    else:
        DOWNtext = ""

    if buttons.left:
        LEFTtext = "LEFT "
    else:
        LEFTtext = ""

    if buttons.up:
        UPtext = "UP "
    else:
        UPtext = ""

    if buttons.a:
        Atext = "A "
    else:
        Atext = ""

    if buttons.b:
        Btext = "B "
    else:
        Btext = ""

    if buttons.select:
        SELtext = "SEL "
    else:
        SELtext = " "

    texts = RIGHTtext + DOWNtext + LEFTtext + UPtext + Atext + Btext + SELtext
    return texts

time.sleep(0.5)

while True:
    text_area = label.Label(terminalio.FONT, text=getbuttons())
    text_area.x = 45
    text_area.y = 38
    wing.display.show(text_area)

code tested with

@makermelissa makermelissa self-assigned this Apr 13, 2019
@makermelissa
Copy link
Collaborator

I need to investigate if this is a seesaw pull-ups issue or something else.

@makermelissa
Copy link
Collaborator

I noticed the Neopixel on my Feather M4 goes red when it does this. Also if I plugged into non-data USB power and then plug into computer USB, it is still red and behaves this way. This might go deeper and possibly be a CP bug. I'll connect a debugger to my Feather (It's modded) and look into that.

@hexthat
Copy link
Contributor Author

hexthat commented Apr 13, 2019

mine stays green when i remove code for neopixel to be off

"""
featherM4 & mini TFT joypad featherwing demo
"""
import board
import terminalio
import time
from adafruit_featherwing import minitft_featherwing
from adafruit_display_text import label
import gc

gc.collect()
print(gc.mem_free())

wing = minitft_featherwing.MiniTFTFeatherWing()

def getbuttons():
    print(wing.buttons)
    buttons = wing.buttons
    if buttons.right:
        RIGHTtext = "RIGHT "
    else:
        RIGHTtext = ""

    if buttons.down:
        DOWNtext = "DOWN "
    else:
        DOWNtext = ""

    if buttons.left:
        LEFTtext = "LEFT "
    else:
        LEFTtext = ""

    if buttons.up:
        UPtext = "UP "
    else:
        UPtext = ""

    if buttons.a:
        Atext = "A "
    else:
        Atext = ""

    if buttons.b:
        Btext = "B "
    else:
        Btext = ""

    if buttons.select:
        SELtext = "SEL "
    else:
        SELtext = " "

    texts = (RIGHTtext + DOWNtext + LEFTtext + UPtext + Atext + Btext + SELtext)
    return texts

time.sleep(0.5)

while True:
    text_area = label.Label(terminalio.FONT, text=getbuttons())
    text_area.x = 45
    text_area.y = 38
    wing.display.show(text_area)

@makermelissa
Copy link
Collaborator

Ok thanks @hexthat, I'll throw the latest beta on there. mine might be a wee bit behind.

@makermelissa
Copy link
Collaborator

Nope, still doing the red thing with Beta 7 for me.

@hexthat
Copy link
Contributor Author

hexthat commented Apr 13, 2019

that is strange, why would they be different between boards?

@makermelissa
Copy link
Collaborator

Also, I'm using the simpletest since the behavior seems to be there too.

@hexthat
Copy link
Contributor Author

hexthat commented Apr 13, 2019

okay ill try that

@hexthat
Copy link
Contributor Author

hexthat commented Apr 13, 2019

neopixel still green for me, even when plugged into power source not PC

dargh im gana put older cp on it then try new beta 7 again

@makermelissa
Copy link
Collaborator

Oh and I'm not using your SPI modification. I'm using it as it is in the repo.

@makermelissa
Copy link
Collaborator

FYI, I just tried on a different feather and it's green.

@hexthat
Copy link
Contributor Author

hexthat commented Apr 13, 2019

oh i was about to think it was cause i changed the CS and DC pins, good to know that wasnt it

@makermelissa
Copy link
Collaborator

Fixed via #39.

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

2 participants