delay(wait) in strandtest sketch

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

delay(wait) in strandtest sketch

Postby bunger » Thu Mar 08, 2012 8:10 pm

First off: just got my flat RGB LEDs strand today and they are A-W-E-S-O-M-E!!

With that said, I was looking through the strandtest sketch and there are calls to delay(wait) in each color sequence loop.

I looked around for the the definition of the wait variable, but couldn't find it in the sketch or libraries. I am new to Arduino programming, so maybe I am not aware that it is something right under my nose?
bunger
 
Posts: 86
Joined: Sun Apr 10, 2011 1:33 pm

Re: delay(wait) in strandtest sketch

Postby pburgess » Thu Mar 08, 2012 8:22 pm

Howdy!

'wait' is a parameter being passed to each animation function. For example, you'll see it's received in the first line of this function here:

Code: Select all
void colorWipe(uint32_t c, uint8_t wait) {
  int i;

  for (i=0; i < strip.numPixels(); i++) {
      strip.setPixelColor(i, c);
      strip.show();
      delay(wait);
  }
}


The value of 'wait' is then specified by the code that's calling colorWipe, e.g. the '10' you see here:

Code: Select all
  colorWipe(strip.Color(127,0,0), 10);
User avatar
pburgess
 
Posts: 1327
Joined: Sun Oct 26, 2008 1:29 am

Re: delay(wait) in strandtest sketch

Postby bunger » Thu Mar 08, 2012 9:30 pm

Doh!!! I TOTALLY missed that. Been a loooooong week!

Thanks for setting me straight.
bunger
 
Posts: 86
Joined: Sun Apr 10, 2011 1:33 pm


Return to Glowy things (LCD, LED, TFT, EL) purchased at Adafruit

Who is online

Users browsing this forum: No registered users and 4 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [102]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[108]
 
Wireless[14]
Cables[60]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[69]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]