Thanks for all the work here!
A few remarks:
- I'm surprised that PIN 1 has a reliable state (i.e. that digitalRead(PNW_DISABLE) will reliably return "HIGH" when not connected), since there doesn't seem to be a pull up resistor. I wonder if something is setting this PIN (which is the LED pin) with INPUT_PULLUP. It may still be worth setting explicitly
- To replace the bootloader, if you don't already own an Arduino Uno, it may be worth buying a dedicated ICSP programmer instead of using an Uno to replace the bootloader. I like the Pololu one at
https://www.pololu.com/product/3172. It may make life easier
- Once you have an ICSP programmer, you don't even need a bootloader, you can directly flash the picknmix application, but a bootloader is convenient if one wants to be able to update later via the USB port instead of using the ICSP programmer.
I made a few modifications to this project, which you can find at
https://github.com/semi-simple/Adafruit_Trinket_Mini_Auto_PICKnMIX
1. Most important: I moved the "sensing" pin to disable PickNMix from PIN 1 to PIN 2. This is because PIN1 is the LED pin and I wanted to use the LED
2. Whenever the trinket pulls pin 0 low (i.e. simulating pressing "start"), the LED is lit. I find it convenient for debugging etc
3. I added a ready-to-flash bootloader in prebuilt/. I'm using micronucleus, which I found to be convenient for me
If you like those modifications, use the GitHub repository above, or you can simply flash this pre-built via ICSP (or via a non-stock bootloader that boot immediately, itself flashed via ICSP):
https://github.com/semi-simple/Adaf...o_PICKnMIX/raw/main/prebuilt/autopicknmix.hex
On an Tiny85 like this Trinket it is actually not technically necessary to have an ICSP programmer. It would be possible to make a "normal" program modify the bootloader. If there was a lot of demand, I would consider doing this, but it's a good bit of work.