#QT py

1 messages · Page 1 of 1 (latest)

teal scaffold
#

'pinMode(pin, INPUT_ PULLUP) should work fine. Note however that for qt py, LED _ BUILTIN is pin 13 which is a fake pin - it is not actually broken out on the board

near mango
#

I am trying to create sound-reactive LEDs for my drumset. I am using QT PY as microcontroller. None of the sketches in the Arduino IDE are working.

teal scaffold
#

i am not sure which tutorial you are referring to. in any case, since there is no regular LED on the board, you need to use the neopixel, modifying as needed the neopixel sketch

#

does the neopixel sketch work?

near mango
#

Here's my non-functioning code

#

Thanks

north escarp
#

The comment // Initialize digital pin LED_BUILTIN as an output. does not match the code pinMode(pin, INPUT_PULLUP)

near mango
#

Changed to LED_BUILTIN, OUTPUT)

north escarp
#

That is now correct (though it is missing the semicolon at the end), however you won't have any luck with that sketch on the QT Py, as @teal scaffold mentioned, because the QT Py does not have a built-in LED like many other Arduino boards.

near mango
#

Ok. I'll keep at it. Here is a working on.

north escarp
#

This one works, because it is using the QT Py's built in NeoPixel. NeoPixels are programmed differently than "normal" LEDs, which is why the code looks a bit different here.

teal scaffold
#

that's a start.
Now you need to look at the tutorial you are using - btw, can you post a link to it? - and replace all commands turning LED on/off by appropriate commands for NeoPixel

#

Note that it is not purely mechanical - you have to make some choices

#

LED can only be on or off; with NeoPixel, you can choose brightness and colors

near mango
#

Thanks!

teal scaffold
#

Yes, I see that. But this is if and only if you want to use some pin as digital input with pullup

near mango
teal scaffold
#

good question

#

there are so many...

#

which is somewhat old, but still very useful