I made a board for my project based on Arduino Pro Mini. The problem is, that I had to put the LED on pin 4 instead of pin 13.
What setting do I have to change to make pin 4 the default one? Or do I have to write my own Board Library?
The blinking while uploading makes the bootloader. Arduino Mini uses Optiboot. The source codes are on GitHub. You would need to change the pin in pin_defs.h and make the bootloader. Then flash it to the 328p with a programmer over ICSP.
Details what to change are in Greenonline's answer.
Following on from Juraj's answer:
The blinking while uploading makes the bootloader. Arduino Mini uses Optiboot. The source codes are on GitHub. You would need to change the pin in pin_defs.h and make the bootloader. Then flash it to the 328p with a programmer over ICSP.
The line that you need to change in pin_defs.h
is line number 27:
#define LED B5
As you can see it is currently set to B5
. This is the fifth bit in port B which corresponds to pin 13
Pin 4 corresponds to PORTD
bit 4, so the line would become
#define LED D4
The Arduino digital pins are connected to three different banks of 8 bits, known as ports (PORTD
, PORTB
and PORTC`). To see their relation, refer to this table from Arduino Playground - Pins