5

To use the onboard LED on an Arduino one usually has to know the pin number (13 in most cases), but is there a constant in the Arduino IDE one can use as well?

So is it possible to use something like int LED = ONBOARDLED; instead of using int LED = 13;?

Greenonline
3,1527 gold badges36 silver badges48 bronze badges
asked Mar 12, 2016 at 19:13

2 Answers 2

4

#define LED_BUILTIN 13

(source)

answered Mar 12, 2016 at 19:24
4

Try LED_BUILTIN:

pins_arduino.h:static const uint8_t LED_BUILTIN = 13;
answered Mar 12, 2016 at 19:24

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.