hi all
im trying to add a button function to a sketch but befor i add the code i tried the example but get errors why ??
/*
||
|| @file Button.pde
|| @version 1.1
|| @author Alexander Brevig
|| @contact alexanderbrevig@gmail.com
||
|| @description
|| | Display the intuitive way of using a button when using this Hardware Abstraction class
|| #
||
|| @license
|| | Copyright (c) 2009 Alexander Brevig. All rights reserved.
|| | This code is subject to AlphaLicence.txt
|| | alphabeta.alexanderbrevig.com/AlphaLicense.txt
|| #
||
*/
#include <Button.h>
//create a Button object at pin 12
/*
|| Wiring:
|| GND -----/ ------ pin 12
*/
Button button12 = Button(12,PULLUP);
void setup(){
Serial.begin(9600);
pinMode(13,OUTPUT); //debug to led 13 ^show led if button pushed
}
void loop(){
if(button12.isPressed()){
digitalWrite(13,HIGH);
Serial.print("12"); //attempt to print to serial as well
delay(250); //set delay
}else{
digitalWrite(13,LOW);
}
}
In file included from sketch_oct25a.cpp:20:
C:\Documents and Settings\Administrator\My Documents\Downloads\arduino-1.0-windows\arduino-1.0\libraries\Button/Button.h:23:22: error: WProgram.h: No such file or directory
In file included from sketch_oct25a.cpp:20:
C:\Documents and Settings\Administrator\My Documents\Downloads\arduino-1.0-windows\arduino-1.0\libraries\Button/Button.h:34: error: expected `)' before 'buttonPin'
C:\Documents and Settings\Administrator\My Documents\Downloads\arduino-1.0-windows\arduino-1.0\libraries\Button/Button.h:42: error: 'uint8_t' does not name a type
C:\Documents and Settings\Administrator\My Documents\Downloads\arduino-1.0-windows\arduino-1.0\libraries\Button/Button.h:43: error: 'uint8_t' does not name a type
C:\Documents and Settings\Administrator\My Documents\Downloads\arduino-1.0-windows\arduino-1.0\libraries\Button/Button.h:44: error: 'uint8_t' does not name a type
sketch_oct25a:26: error: no matching function for call to 'Button::Button(int, int)'
C:\Documents and Settings\Administrator\My Documents\Downloads\arduino-1.0-windows\arduino-1.0\libraries\Button/Button.h:32: note: candidates are: Button::Button()
C:\Documents and Settings\Administrator\My Documents\Downloads\arduino-1.0-windows\arduino-1.0\libraries\Button/Button.h:32: note: Button::Button(const Button&)