View Single Post
  #3   Spotlight this post!  
Unread 14-12-2011, 09:50
Dave Scheck's Avatar
Dave Scheck Dave Scheck is offline
Registered User
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Feb 2003
Rookie Year: 2002
Location: Arlington Heights, IL
Posts: 574
Dave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond repute
Re: Arduino help -RGB LED

There are a few things in the last code block that you posted in that thread that are concerning.

1. When you initialize your buttonState and lastButtonState varibales at the top, you set them to 0. You should use your LOW/HIGH constants. Depending on how those constants are defined, you could have trouble in your initial comparisons. (probably not causing your problem)

2. I don't see you setting lastbuttonState within your loop. (probably not causing your problem, but will be a problem once your current issue is resolved)

3. You are missing a == in if(pushCounter = 4). That will always evaluates to true and always assign 0 to pushCounter (probably the cause of your problem)