Skip to content

LED_BUILTIN not working on Pico2 W #2644

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
skpang opened this issue Nov 27, 2024 · 4 comments · Fixed by #2646
Closed

LED_BUILTIN not working on Pico2 W #2644

skpang opened this issue Nov 27, 2024 · 4 comments · Fixed by #2646
Labels
bug Something isn't working waiting for feedback Requires response from original poster

Comments

@skpang
Copy link

skpang commented Nov 27, 2024

I'm trying to blink the on board LED on the Pico2 W but the LED is not coming on.

pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);

This is working on a Pico W.

I'm using library v4.3.0

Does it need updating for the Pico2 W ?

@earlephilhower
Copy link
Owner

Please double check you have selected the Pico 2 W board from the menus, and also please run the blink.ino example. I forget the exact polarity of the LED (high=on or high=off) on that board.

@skpang
Copy link
Author

skpang commented Nov 27, 2024

This is the code I'm using :
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

It works on a Pico W but when I swap the board to a Pico 2W and changed the board to Pico 2W, upload the same sketch the LED on board does not come on or blink. I've also tried on another Pico 2W with the same result.

@earlephilhower earlephilhower added the waiting for feedback Requires response from original poster label Nov 27, 2024
@earlephilhower
Copy link
Owner

Thanks for checking. It's one of the teething problems in the Pico2W release. Replace LED_BUILTIN with 64 and it should work.

I'll be updating this line to the right pin...

#define PIN_LED (25u)

@earlephilhower earlephilhower added the bug Something isn't working label Nov 27, 2024
earlephilhower added a commit that referenced this issue Nov 27, 2024
@skpang
Copy link
Author

skpang commented Nov 27, 2024

Ok, changed to 64 and the LED now blinks.
Thanks.

@skpang skpang closed this as completed Nov 27, 2024
earlephilhower added a commit that referenced this issue Nov 27, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working waiting for feedback Requires response from original poster
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants