How do I change the default LED pin for displaying uploading

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












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?







share|improve this question


























    up vote
    2
    down vote

    favorite












    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?







    share|improve this question
























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      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?







      share|improve this question














      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?









      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 14 at 9:27









      Greenonline

      1,90941539




      1,90941539










      asked Aug 14 at 9:04









      Antonín Gazda

      133




      133




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          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.






          share|improve this answer





























            up vote
            2
            down vote













            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




            Ports to Pins table







            share|improve this answer






















            • I copied my answer as intro into this answer
              – Juraj
              Aug 14 at 12:15










            • Ok, thanks. I'm not sure it was necessary, unless you planned on deleting your answer. However, I've added a link back to yours to reference the quote, and it makes a bit more sense that way. Thanks again :-).
              – Greenonline
              Aug 14 at 13:56










            Your Answer





            StackExchange.ifUsing("editor", function ()
            return StackExchange.using("schematics", function ()
            StackExchange.schematics.init();
            );
            , "cicuitlab");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "540"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2farduino.stackexchange.com%2fquestions%2f55279%2fhow-do-i-change-the-default-led-pin-for-displaying-uploading%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            3
            down vote



            accepted










            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.






            share|improve this answer


























              up vote
              3
              down vote



              accepted










              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.






              share|improve this answer
























                up vote
                3
                down vote



                accepted







                up vote
                3
                down vote



                accepted






                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.






                share|improve this 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.



                Details what to change are in Greenonline's answer.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Aug 14 at 13:54









                Greenonline

                1,90941539




                1,90941539










                answered Aug 14 at 9:23









                Juraj

                3,4211317




                3,4211317




















                    up vote
                    2
                    down vote













                    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




                    Ports to Pins table







                    share|improve this answer






















                    • I copied my answer as intro into this answer
                      – Juraj
                      Aug 14 at 12:15










                    • Ok, thanks. I'm not sure it was necessary, unless you planned on deleting your answer. However, I've added a link back to yours to reference the quote, and it makes a bit more sense that way. Thanks again :-).
                      – Greenonline
                      Aug 14 at 13:56














                    up vote
                    2
                    down vote













                    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




                    Ports to Pins table







                    share|improve this answer






















                    • I copied my answer as intro into this answer
                      – Juraj
                      Aug 14 at 12:15










                    • Ok, thanks. I'm not sure it was necessary, unless you planned on deleting your answer. However, I've added a link back to yours to reference the quote, and it makes a bit more sense that way. Thanks again :-).
                      – Greenonline
                      Aug 14 at 13:56












                    up vote
                    2
                    down vote










                    up vote
                    2
                    down vote









                    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




                    Ports to Pins table







                    share|improve this 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




                    Ports to Pins table








                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Aug 14 at 13:54

























                    answered Aug 14 at 9:37









                    Greenonline

                    1,90941539




                    1,90941539











                    • I copied my answer as intro into this answer
                      – Juraj
                      Aug 14 at 12:15










                    • Ok, thanks. I'm not sure it was necessary, unless you planned on deleting your answer. However, I've added a link back to yours to reference the quote, and it makes a bit more sense that way. Thanks again :-).
                      – Greenonline
                      Aug 14 at 13:56
















                    • I copied my answer as intro into this answer
                      – Juraj
                      Aug 14 at 12:15










                    • Ok, thanks. I'm not sure it was necessary, unless you planned on deleting your answer. However, I've added a link back to yours to reference the quote, and it makes a bit more sense that way. Thanks again :-).
                      – Greenonline
                      Aug 14 at 13:56















                    I copied my answer as intro into this answer
                    – Juraj
                    Aug 14 at 12:15




                    I copied my answer as intro into this answer
                    – Juraj
                    Aug 14 at 12:15












                    Ok, thanks. I'm not sure it was necessary, unless you planned on deleting your answer. However, I've added a link back to yours to reference the quote, and it makes a bit more sense that way. Thanks again :-).
                    – Greenonline
                    Aug 14 at 13:56




                    Ok, thanks. I'm not sure it was necessary, unless you planned on deleting your answer. However, I've added a link back to yours to reference the quote, and it makes a bit more sense that way. Thanks again :-).
                    – Greenonline
                    Aug 14 at 13:56

















                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2farduino.stackexchange.com%2fquestions%2f55279%2fhow-do-i-change-the-default-led-pin-for-displaying-uploading%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    Long meetings (6-7 hours a day): Being “babysat” by supervisor

                    Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

                    Confectionery