albertinjo wrote:The bootloader works really weird on my aruino, the loader sketch works fine, I can read files from my sd card with the SDfat library. Only problem is that I cant invoke the loader sketch while holding the C button on startup??
I got interested and looked at the code.
The bootloader code does not "wait" to read the state of the C button at all, it is checking the state once and almost immediately after reset.
My suspicion is that there is nothing wrong with the code, but that your C button, reason or another, is not low when the bootloader runs (line 307 in gamebuino_boot.c in GitHub). It can pick up interference from an adjacent pin or something. Another factor overlooked sometimes is that breadboarded circuits behave slightly differently to circuitboarded circuits due to the electrical characteristics of a breadboard. This can affect the volatility of a pin, especially directly after a reset. (Myndale can correct me if I'm talking rubbish).
I would try these two tricks:
1) Force the button C (PC3, arduino pin A03) into low state by binding it to GND through a 10k resistor. Then reset and see if loader comes up.
2) If this helps, remove resistor and write a small waiting loop around the C button state check on line 307 in gamebuino_boot.c