Neokey 1x4 Help

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
justclicky
 
Posts: 1
Joined: Thu Dec 01, 2022 4:29 am

Neokey 1x4 Help

Post by justclicky »

I’ve recently got neokey 1x4 and have it nicely working with Raspberry Pi: Adafruit provides CircuitPython and Arduino (cpp) libraries - but it felt too complicated (the libraries and porting them to normal Python with smbus on Raspberry Pi). So, I just went down to trace code for what is needed from i2c traffic perspective and converted it to use smbus2 (needed for sending two byte ‘internal address’ for read and write). Reading the code from github I gathered that it all boiled down to 6 initialisation calls (4 for defining GPIOs, interrupts, pullups and something else + 2 for writing to LEDs). And for main loop operation - it needed two writes for setting up leds and one read for reading gpio states. That part was easy and relatively logical/simple.

Problem started with PiPico. First part with Raspberry Pi I did just as ‘discovery’ phase until I moved it to PiPico. I made same calls from PiPico and yet I can’t make it work!

I can have LEDs set and they work well, or I can get GPIO’s states read. But not both! Main problem is that if I invoke ‘NEOPIXEL_SHOW’ (a ‘command’ to move some kind of buffer to output for LEDs) reading GPIOs immediately stopa and all I get back are 1s (255). I have tried different timings, ensured that ordering of i2c operations is same across two platforms (I spent more time sorting out debug info than anything else) and still nothing.

The question is: does anyone have similar experience or better - any idea where to go to try to find out who’s the author of the µController code who might be able to shed more light to this behaviour (and more importantly maybe suggest some ways around the problem I have).

User avatar
adafruit_support_carter
 
Posts: 29150
Joined: Tue Nov 29, 2016 2:45 pm

Re: Neokey 1x4 Help

Post by adafruit_support_carter »

The firmware running on the NeoKey itself is here:
https://github.com/adafruit/seesaw

Basic info on the seesaw protocol is here:
https://learn.adafruit.com/adafruit-see ... w-platform

The source code for the CircuitPython library is here:
https://github.com/adafruit/Adafruit_Ci ... hon_NeoKey

Is the behavior also happening when using the NeoKey per the guide?
https://learn.adafruit.com/neokey-1x4-q ... cuitpython

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”