I am working on making some custom 12-key macro keypads based off of the Arduino Leonardo/Pro Micro architecture. I ordered some custom PCBs, and they have finally arrived. I used an Arduino Uno as an ISP to flash the bootloader onto them, and besides me having flipped the USB data pins (which I have now fixed), everything seems to be working fine.
I have programmed a blink sketch onto them, and I have tested them with the Arduino IDE. Everything is working as expected except the pin numbers. My circuit uses 7 pins for the button matrix, 3 output, 4 input with pullup resistors, and, I selected them so they would be pins 2-8 in the IDE. The matrix is connected to pins 19, 18, 25, 31, 27, 1, and 28 respectively on the microcontroller, and those seem to line up with Arduino breakout pins 2-8 from what I have looked up. That said, the numbers 2-8 have not worked when I try to set the states of these pins.
The part that is confusing me is that I tried some other numbers, and I have gotten the numbers 24, 25, 26, and 27 to work in the IDE, mapping to the pins I thought would be numbered 4, 6, 8, and 9 (which will be used for LEDs on my board) respectively. Does anyone know what might be going on?
I would be happy to share more info, and I can provide the Gerber files (I don't have an accurate schematic), but seeing as this is already getting long and I don't know what information will be useful, I'll leave it at this for now. If you would like more info, please ask, and I'll try to get it to you as soon as possible. Thank you so much for the help!
Note that if you create your own "board" type, you can re-map the pins however you want (note that some functions (pwm, I2C, serial, etc) follow the internal port/bits, so if you move those pins the functions will move too.)
That's really interesting! I never knew you could do that, and since I am possibly going to make another version in the future, I'll look into some more details. Thank you so much for the tip!