CrazyRobMiles / PICO-MIDI-Crackers-Controller

Full instructions to make a MIDI controller using a PICO, rotary encoders and pixel rings
18 stars 0 forks source link

Code issues #1

Open viragored opened 12 months ago

viragored commented 12 months ago

I've finally assembled one of these - the hardware all checked out with my test code but the software didn't work. The code doesn't match the GPIO wiring in Hackspace #49. These fixes made it work for me - as far as I can tell. In class CrackersController: self.controllers = [

Button GP pins should be 1=12; 2=13; 3=14; 4=15 [Not 14,15,17,12]

    # encoder_pins should be 4,5; 6,7; 8,9; 10,11 [Not 1=8,9; 2=10,11; 3=6,7; 4=4,5] - at least on my physical build
    # pixel_start should be 1=36; 2=24 
    # alter "forward" to suit the user's actual wiring

In class Controller(): def button_down(self): The logic appears to be reversed, so all neopixels change colour when one button is pressed, and not just the encoder that is pressed Change the next line to: if not self.client.change_all_controllers:

CrazyRobMiles commented 11 months ago

Hi. Sorry to hear you had problems getting it to work. The pins thing is a problem. I think the circuit diagram is not very helpful as it doesn't have explicit pin assignments. I'll add a paragraph to the help telling folks they can build it how they like and then point then them at the code to change.

The change all thing was an idea that I wanted to have them all change at once so I could have "pages" of settings. The idea was that you make change_all_controllers false if you want that behaviour. I was going to add a behaviour (for example press all the buttons at once) to toggle the setting but never got round to it.