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
#define LED_BUILTIN 13
(source)
answered Mar 12, 2016 at 19:24
Try LED_BUILTIN
:
pins_arduino.h:static const uint8_t LED_BUILTIN = 13;
answered Mar 12, 2016 at 19:24