First of all, it would really help if someone added Qt-Py to the title of this topic area or created a new one for it. Thanks.
Secondly, I'm really frustrated because all the examples and tutorials seems to say, "this doesn't work with the Qt-Py" or something like that. I'm just trying to blink the LED in some fashion to get started. I realize that it doesn't have a regular LED like many boards but I can't find an example that works to simply blink the Neopixel LED module in any fashion at all as a starting point.
I'm looking at the Circuit Python example: https://learn.adafruit.com/adafruit-qt- ... al-rgb-led
But it doesn't seem to work.
Is there some simple example for Qt-Py that I can use as a starting point?
Qt Py
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- dastels
- Posts: 15820
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Qt Py
You can use the example code at https://learn.adafruit.com/adafruit-qt- ... n-neopixel and change
to
Dave
Code: Select all
pixel_pin = board.A1
Code: Select all
pixel_pin = board.NEOPIXEL
- jwhance
- Posts: 28
- Joined: Sun Dec 11, 2011 8:54 am
Re: Qt Py
Dave,
Thanks, I tried that but I must be missing something basic. I am using Mu (as recommended) and I can never get anything to happen on the Qt-Py but the green LED fading in and out.
How do I get the code I've written in Mu to "take" on the Qt-Py? The save does save it to the virtual drive but it never seems to run. I can see my file there on the "E:" drive.
If I open the serial monitor and get to the REPL, I can do Python but that stops the green LED from changing until I ^D.
Thanks, I tried that but I must be missing something basic. I am using Mu (as recommended) and I can never get anything to happen on the Qt-Py but the green LED fading in and out.
How do I get the code I've written in Mu to "take" on the Qt-Py? The save does save it to the virtual drive but it never seems to run. I can see my file there on the "E:" drive.
If I open the serial monitor and get to the REPL, I can do Python but that stops the green LED from changing until I ^D.
- adafruit2
- Posts: 22194
- Joined: Fri Mar 11, 2005 7:36 pm
Re: Qt Py
check this guide for more!
https://learn.adafruit.com/welcome-to-circuitpython
https://learn.adafruit.com/welcome-to-circuitpython
- jwhance
- Posts: 28
- Joined: Sun Dec 11, 2011 8:54 am
Re: Qt Py
It's perfectly obvious how to control the LEDs on the QT-Py once you understand the NeoPixel. But that assumes that you've worked with one before. For some reason Adafruit leaves out a working example of blinking the LED on the QT-Py which was frustrating. Here is a working example to help someone get started with the Arduino IDE path vs. CircuitPython.
Code: Select all
/*
Blink NeoPixel
Turns the QT-Py BLUE LED on for one second, then off for one second, repeatedly.
Most Arduinos have an on-board LED you can control. The Adafruit QT-Py does not have
such an LED. It has an on-board Neopixel tri-color (red, green, blue) "smart" LED.
While not difficult to use, it takes a bit more code and an external library to
blink the LED.
This example code is in the public domain.
*/
// Must include the Adafruit NeoPixed library and include the header file here
#include <Adafruit_NeoPixel.h>
#define PIN PIN_NEOPIXEL
#define NUMPIXELS 1 // The on-board Neopixed has a single pixel
// Create a NeoPixel object to contole the device on PIN
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
// the setup function runs once when you press reset or power the board
void setup() {
// Start the NeoPixel object
pixels.begin();
}
// the loop function runs over and over again forever
void loop() {
pixels.clear();
for(int i=0; i<NUMPIXELS; i++) {
//
// The LED color is controlled by the RGB (Red/Green/Blue) values
// passed in the Color() method. Each is a value from 0
// to 255 that is the brightness of that color's LED. In this
// example only the BLUE LED is being toggled between fully ON (255)
// and fully OFF (0)
//
pixels.setPixelColor(i, pixels.Color(0, 0, 255));
pixels.show();
delay(1000);
pixels.setPixelColor(i, pixels.Color(0, 0, 0));
pixels.show();
delay(1000);
}
}
Please be positive and constructive with your questions and comments.