Giter VIP home page Giter VIP logo

Comments (3)

khoih-prog avatar khoih-prog commented on July 17, 2024

HI @badger200

The example is only for general RP2040. While RP2040W is very different, by using LED @ symbolic pin GPIO32, which is controlled only by CYW43 chip

https://github.com/earlephilhower/arduino-pico/blob/master/variants/rpipicow/pins_arduino.h#L8

https://github.com/earlephilhower/arduino-pico/blob/aeb41f3e70628e63ed1cf13f2031cdaf61d65ad0/variants/rpipicow/picow_digital.cpp#L35-L49

Therefore, the PWM can't control the RP2040W LED.

Try to use a different pin and connect LED to it.

from rp2040_pwm.

badger200 avatar badger200 commented on July 17, 2024

I did find a reference example from official Raspberry Pi GitHub: https://github.com/raspberrypi/pico-examples/blob/master/pico_w/blink/picow_blink.c

And it works on my Pico W, however I did not try PWM fading.

from rp2040_pwm.

khoih-prog avatar khoih-prog commented on July 17, 2024

You really don't need that fancy code for RP2040W_BUILTIN_LED

Just use normal code with digitalWrite()

#define RP2040W_BUILTIN_LED       32

void setup() 
{
  pinMode(RP2040W_BUILTIN_LED, OUTPUT);
}

void loop() 
{
  digitalWrite(RP2040W_BUILTIN_LED, HIGH);
  delay(2000);
  digitalWrite(RP2040W_BUILTIN_LED, LOW);
  delay(2000);
}

from rp2040_pwm.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.