'btn_Digital' was not declared in this scope

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
vipond50
 
Posts: 13
Joined: Wed Oct 19, 2011 5:14 am

'btn_Digital' was not declared in this scope

Post by vipond50 »

Ok..
This morning i decided to look at a Advance Button demo and when I compile the sketch, i get this 'btn_Digital' was not declared in this scope"
I am using the most current version of Advance button(Ver11) the 0023 version with a UNO. The Lib are included in the Arduino libs, and when i attempt a Compile, I still receive the error......
I did not write this or knowingly change any aspect of the demo so I am a bit confused...
Any ideas??????

User avatar
baldengineer
 
Posts: 127
Joined: Sun Sep 26, 2010 11:49 pm

Re: 'btn_Digital' was not declared in this scope

Post by baldengineer »

Not posting the actual code you are trying to compile makes it difficult to debug the code you are trying to debug.

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

Re: 'btn_Digital' was not declared in this scope

Post by adafruit_support_bill »

Sounds like the library was not installed properly. Or, it might be that you did not re-start the IDE after installing the library. The IDE does not recognize libraries that were installed after it starts up.

vipond50
 
Posts: 13
Joined: Wed Oct 19, 2011 5:14 am

Re: 'btn_Digital' was not declared in this scope

Post by vipond50 »

@JamesC4S....
The Sketch is a AdvButton Demo... supplied with the AdvButton Library...

@adafruit_support
It's interesting that all the other Libraries that i have installed, function...I used the same procedure with this one....
You tell me
Have either of you gone a got the library, installed it and tried to run the demo?????

Code: Select all


This is a demo sketch showing the Advanced Button 
library features for the Arduino platform. This demo
requires 4 buttons connected on pin 2,3,4,5 and 4 LED's
connected on pins 8,9,10,11. Each button will show 
a different behaviour:

Button1: Demonstrates the keypress events. Upon pressing, 
LED 1 will light up shortly showing the key is down. After
a short delay (1 second) the keypress event will occur
every 100 millisseconds blinking the LED shortly.

Button2: Shows the basic key up/down events. LED 2 will
light up while button 2 is pressed, until the button is 
released.

Button3: Records the amount of time the button is pressed
and lights up LED3 for the same duration.

Button4: Shows a on/off switch. Upon pressing for the first 
time LED 4 will start blinking. Pressing again will stop
the LED from blinking.

*/


#include <AdvButton.h>
#include <ButtonManager.h>

#define PINBUTTON1 2
#define PINBUTTON2 3
#define PINBUTTON3 4
#define PINBUTTON4 5

#define PINLIGHT1 8
#define PINLIGHT2 9
#define PINLIGHT3 10
#define PINLIGHT4 11

AdvButton but1 = AdvButton(PINBUTTON1,OnKeyPressBut1,100,1000,btn_Digital);
AdvButton but2 = AdvButton(PINBUTTON2,NULL,OnKeyDownBut2,OnKeyUpBut2,btn_Digital);
AdvButton but3 = AdvButton(PINBUTTON3,NULL,NULL,OnKeyUpBut3,btn_Digital);
AdvButton but4 = AdvButton(PINBUTTON4,NULL,OnKeyDownBut4,NULL,btn_Digital);

boolean blinking = false;

void setup()
{
  
  
}

void OnKeyPressBut1(AdvButton* but)
{
  digitalWrite(PINLIGHT1,HIGH);
  delay(5);
  digitalWrite(PINLIGHT1,LOW);
}


void OnKeyDownBut2(AdvButton* but)
{
  digitalWrite(PINLIGHT2,HIGH);
  
}

void OnKeyUpBut2(AdvButton* but)
{
  digitalWrite(PINLIGHT2,LOW);
}

void OnKeyUpBut3(AdvButton* but)
{
  digitalWrite(PINLIGHT3,HIGH);
  delay(but->getPressTime());
  digitalWrite(PINLIGHT3,LOW);
}

void OnKeyDownBut4(AdvButton* but)
{
  blinking = !blinking;  
}

void loop()
{
  ButtonManager::instance()->checkButtons();
 
  if (blinking)
  {
    if (millis() % 500 > 250)
    {
      digitalWrite(PINLIGHT4,HIGH);
    }
    else
    {
      digitalWrite(PINLIGHT4,LOW);     
    }
  }
  else
    digitalWrite(PINLIGHT4,LOW);
   
}

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

Re: 'btn_Digital' was not declared in this scope

Post by adafruit_support_bill »

You tell me
Have either of you gone a got the library, installed it and tried to run the demo?????
You did not provide a link, so there is no way we could have tested it.
If you suspect a problem with the library, you should contact the author.

vipond50
 
Posts: 13
Joined: Wed Oct 19, 2011 5:14 am

Re: 'btn_Digital' was not declared in this scope

Post by vipond50 »

Thanks for the response...
Sorry if I come across as a grumpy.....
Here's the link to where I downloaded the Lib

http://www.arduino.cc/playground/Code/AdvButton

Scroll down to

"Download, install and import"

Download here: Attach:AdvButton_11.zip
Note: in the download there is a Demo that I am speaking of.

I will shoot an email to Bart Meijer ([email protected]) to the relating....
Thanks again
B.

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

Return to “Arduino”