#QT py
1 messages · Page 1 of 1 (latest)
'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
I do not understand exactly what the code should be. In the tutorial I saw pinMode(pin, INPUT PULLUP) replaces 2 lines of code. But how is the rest of the sketch affected?
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.
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?
The comment // Initialize digital pin LED_BUILTIN as an output. does not match the code pinMode(pin, INPUT_PULLUP)
Changed to LED_BUILTIN, OUTPUT)
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.
Ok. I'll keep at it. Here is a working on.
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.
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
quick google search gives some projects that use NeoPixels to react to music; maybe you can borrow ideas from them:
https://www.instructables.com/How-to-Make-Musical-NeoPixel-LED-Lights-/
I used this reference: https://learn.adafruit.com/adafruit-qt-py/adapting-sketches-to-m0-m4. Scrolling the first page you see the instance of pinMode(pin, INPUT_PULLUP)
Thanks!
Yes, I see that. But this is if and only if you want to use some pin as digital input with pullup
Can you recommend a manual or resource for the Arduino IDE
good question
there are so many...
Adafruit has this series: https://learn.adafruit.com/lesson-0-getting-started
which is somewhat old, but still very useful