Absolute Newb.. easy coding query

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

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
an1mal_69
 
Posts: 3
Joined: Fri Sep 05, 2014 5:48 am

Absolute Newb.. easy coding query

Post by an1mal_69 »

Hi guys, I'm slowly getting an understanding of arduino and the neopixels, I'm planning on using them as ceiling lights in my camper van.

I'm getting comfortable with editing the code to achieve the effects I want, but I would like to be able to move to the next 'effect' within the sketch using a push button as opposed to the wait command.

So in effect the code would loop until it sees input from the button, then move on..seems really simple, I just can't find the right command.

Any advice greatly received.

Cheers, Nik..

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: Absolute Newb.. easy coding query

Post by adafruit_support_bill »

Have you got the button wired up yet? Lesson 6 shows how: https://learn.adafruit.com/adafruit-ard ... tal-inputs

To wait for a button press:

Code: Select all

while(digitalRead(buttonPin) == HIGH); // this will loop until the button is pressed

User avatar
an1mal_69
 
Posts: 3
Joined: Fri Sep 05, 2014 5:48 am

Re: Absolute Newb.. easy coding query

Post by an1mal_69 »

Excellent..much obliged Bill!!

Locked
Please be positive and constructive with your questions and comments.

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