Hi there,
I'm new to microcontrollers and coding and what not. I design and build my own guitar FX pedals and want to eventually be able to use a board to offer relay-based bypass switching, MIDI control, I2C display, and digital potentiometer control.
I'm starting with the relay switching because it seems easiest haha! I have messed around with the stock code for digital io and understand how to assign the various pins to input/output and using a basic if/else function, but I can't seem to come up with a code that would let me toggle the state of the LED with the momentary switch where a button push would turn it on indefinitely, then another button push would turn it off indefinitely, if that makes sense. I want code to latch the state of the LED with momentary switch state change.
What library/libraries do I need to explore? Would anyone be able to show me an example? I've searched dozens of Google search results searching for code but have been unsuccessful in finding an example.
Thanks!
BTW I'm using Mu editor with circuitpython on a Seeeduino XIAO that has a SAMD21G18 chip. I also have an Arduino Nano (ATmega328 ) and have tinkered around with IDE but the Mu editor and python code seems WAY easier to use, so far at least.