ITEM FOR A SOFTAIR GAME
i'm crazy week try figure out error lies in telling me arduin verification when try load program run countdown , other things serve game called softai
i put under whole code , tell mistake please me
'menuprincipal' not declared in scope
/tmp/920426219/time_bomb_airsoft_game/time_bomb_airsoft_game.ino: in function 'void loop()':
/tmp/920426219/time_bomb_airsoft_game/time_bomb_airsoft_game.ino:194:17: error: 'menuprincipal' not declared in scope
menuprincipal();
^
exit status 1
#include <wire.h>
#include <keypad.h>
//#include <liquidcrystal_i2c.h>
#include <liquidcrystal.h>
/*
arduino bomb pro
the circuit:
* more info @ : http://yin.mainstreamds.com/
if need mail me yinbot@gmail.com
created 4,sep, 2010
modified 11 nov 2015
by ignacio lillo
*/
//liquidcrystal_i2c lcd(0x38,16,2);
liquidcrystal lcd(7, 6, 5, 4, 3, 2);
const byte rows = 4; //four rows
const byte cols = 4; //three columns
char keys[rows][cols] = {
{'1','2','3','a'}
,
{'4','5','6','b'}
,
{'7','8','9','c'}
,
{'*','0','#','d'}
};
byte rowpins[rows] = {
12, 13, a5, a4}; //connect row pinouts of keypad
byte colpins[cols] = {
a3, a2, a1, a0
}; //connect column pinouts of keypad
keypad keypad = keypad( makekeymap(keys), rowpins, colpins, rows, cols );
char codeinput[8];
byte time[4];
boolean refresh=true;//1 refresh 1 time...
char password[8];
int key=-1;
char lastkey;
char var;
boolean passwordenable=false;
//buttons lcd shield
char bt_right = '4';
char bt_up = 'a';
char bt_down = 'b';
char bt_left = '6';
char bt_sel = 'd'; // ok key
char bt_cancel = 'c';
char bt_defuser = 'x'; // not implemented
//leds
const int redled = 11;
const int greenled = 10;
//const int blueled = 12;
//relaypin
boolean relayenable = false;
const int relaypin = 9;
//is important test time. default in 1 sec. not much. test it!
const int relay_time = 5000;
//time ints
int gamehours = 0;
int gameminutes = 45;
int bombminutes = 4;
int activateseconds = 5;
boolean endgame = false;
boolean sdstatus = false; //search , destroy game enable used in config
boolean sastatus = false; //same sabotaghe
boolean dostatus = false; //for demolition
boolean start = true;
boolean defusing;
boolean cancelando;
// sound tones
boolean soundenable = true;
int tonepin = 8; // pin 13 sound
int alarmtone1 = 700;
int alarmtone2 = 2600;
int activetone = 1330;
int errortone = 100;
unsigned long itime;
unsigned long timecalcvar;
unsigned long redtime;
unsigned long greentime;
unsigned long izonetime;//initial time zone
byte team=0; // 0 = neutral, 1 = green team, 2 = red team
void setup(){
lcd.begin(16, 2);
serial.begin(9600);
lcd.setcursor(3,0);
tone(tonepin,2400,30);
lcd.print("bluecore tech");// can add team name or someting cool
lcd.setcursor(0,1);
lcd.print(" airsoft bomb");// can add team name or someting cool
keypad.setholdtime(50);
keypad.setdebouncetime(50);
keypad.addeventlistener(keypadevent);
//pinmodes
pinmode(greenled, output);
pinmode(redled, output);
pinmode(relaypin, output);
// configure bars of progress bar
byte bar1[8] = {
b10000,
b10000,
b10000,
b10000,
b10000,
b10000,
b10000,
b10000,
};
byte bar2[8] = {
b11000,
b11000,
b11000,
b11000,
b11000,
b11000,
b11000,
b11000,
};
byte bar3[8] = {
b11100,
b11100,
b11100,
b11100,
b11100,
b11100,
b11100,
b11100,
};
byte bar4[8] = {
b11110,
b11110,
b11110,
b11110,
b11110,
b11110,
b11110,
b11110,
};
byte bar5[8] = {
b11111,
b11111,
b11111,
b11111,
b11111,
b11111,
b11111,
b11111,
};
byte up[8] = {
b00000,
b00100,
b01110,
b11111,
b11111,
b00000,
b00000,
};
byte down[8] = {
b00000,
b00000,
b11111,
b11111,
b01110,
b00100,
b00000,
};
lcd.createchar(0,bar1);
lcd.createchar(1,bar2);
lcd.createchar(2,bar3);
lcd.createchar(3,bar4);
lcd.createchar(4,bar5);
lcd.createchar(5,up);
lcd.createchar(6,down);
}
void loop(){
menuprincipal();
}
void keypadevent(keypadevent key){
switch (keypad.getstate()){
case released:
switch (key){
case 'd': defusing=false;
break;
case 'c': cancelando=false;
break;
}
break;
case hold:
switch (key){
case 'd': defusing= true;
break;
case 'c': cancelando=true;
break;
}
break;
}
}
i put under whole code , tell mistake please me
'menuprincipal' not declared in scope
/tmp/920426219/time_bomb_airsoft_game/time_bomb_airsoft_game.ino: in function 'void loop()':
/tmp/920426219/time_bomb_airsoft_game/time_bomb_airsoft_game.ino:194:17: error: 'menuprincipal' not declared in scope
menuprincipal();
^
exit status 1
#include <wire.h>
#include <keypad.h>
//#include <liquidcrystal_i2c.h>
#include <liquidcrystal.h>
/*
arduino bomb pro
the circuit:
* more info @ : http://yin.mainstreamds.com/
if need mail me yinbot@gmail.com
created 4,sep, 2010
modified 11 nov 2015
by ignacio lillo
*/
//liquidcrystal_i2c lcd(0x38,16,2);
liquidcrystal lcd(7, 6, 5, 4, 3, 2);
const byte rows = 4; //four rows
const byte cols = 4; //three columns
char keys[rows][cols] = {
{'1','2','3','a'}
,
{'4','5','6','b'}
,
{'7','8','9','c'}
,
{'*','0','#','d'}
};
byte rowpins[rows] = {
12, 13, a5, a4}; //connect row pinouts of keypad
byte colpins[cols] = {
a3, a2, a1, a0
}; //connect column pinouts of keypad
keypad keypad = keypad( makekeymap(keys), rowpins, colpins, rows, cols );
char codeinput[8];
byte time[4];
boolean refresh=true;//1 refresh 1 time...
char password[8];
int key=-1;
char lastkey;
char var;
boolean passwordenable=false;
//buttons lcd shield
char bt_right = '4';
char bt_up = 'a';
char bt_down = 'b';
char bt_left = '6';
char bt_sel = 'd'; // ok key
char bt_cancel = 'c';
char bt_defuser = 'x'; // not implemented
//leds
const int redled = 11;
const int greenled = 10;
//const int blueled = 12;
//relaypin
boolean relayenable = false;
const int relaypin = 9;
//is important test time. default in 1 sec. not much. test it!
const int relay_time = 5000;
//time ints
int gamehours = 0;
int gameminutes = 45;
int bombminutes = 4;
int activateseconds = 5;
boolean endgame = false;
boolean sdstatus = false; //search , destroy game enable used in config
boolean sastatus = false; //same sabotaghe
boolean dostatus = false; //for demolition
boolean start = true;
boolean defusing;
boolean cancelando;
// sound tones
boolean soundenable = true;
int tonepin = 8; // pin 13 sound
int alarmtone1 = 700;
int alarmtone2 = 2600;
int activetone = 1330;
int errortone = 100;
unsigned long itime;
unsigned long timecalcvar;
unsigned long redtime;
unsigned long greentime;
unsigned long izonetime;//initial time zone
byte team=0; // 0 = neutral, 1 = green team, 2 = red team
void setup(){
lcd.begin(16, 2);
serial.begin(9600);
lcd.setcursor(3,0);
tone(tonepin,2400,30);
lcd.print("bluecore tech");// can add team name or someting cool
lcd.setcursor(0,1);
lcd.print(" airsoft bomb");// can add team name or someting cool
keypad.setholdtime(50);
keypad.setdebouncetime(50);
keypad.addeventlistener(keypadevent);
//pinmodes
pinmode(greenled, output);
pinmode(redled, output);
pinmode(relaypin, output);
// configure bars of progress bar
byte bar1[8] = {
b10000,
b10000,
b10000,
b10000,
b10000,
b10000,
b10000,
b10000,
};
byte bar2[8] = {
b11000,
b11000,
b11000,
b11000,
b11000,
b11000,
b11000,
b11000,
};
byte bar3[8] = {
b11100,
b11100,
b11100,
b11100,
b11100,
b11100,
b11100,
b11100,
};
byte bar4[8] = {
b11110,
b11110,
b11110,
b11110,
b11110,
b11110,
b11110,
b11110,
};
byte bar5[8] = {
b11111,
b11111,
b11111,
b11111,
b11111,
b11111,
b11111,
b11111,
};
byte up[8] = {
b00000,
b00100,
b01110,
b11111,
b11111,
b00000,
b00000,
};
byte down[8] = {
b00000,
b00000,
b11111,
b11111,
b01110,
b00100,
b00000,
};
lcd.createchar(0,bar1);
lcd.createchar(1,bar2);
lcd.createchar(2,bar3);
lcd.createchar(3,bar4);
lcd.createchar(4,bar5);
lcd.createchar(5,up);
lcd.createchar(6,down);
}
void loop(){
menuprincipal();
}
void keypadevent(keypadevent key){
switch (keypad.getstate()){
case released:
switch (key){
case 'd': defusing=false;
break;
case 'c': cancelando=false;
break;
}
break;
case hold:
switch (key){
case 'd': defusing= true;
break;
case 'c': cancelando=true;
break;
}
break;
}
}
well it's right. calling function called menuprincipal in code haven't created function name.
Arduino Forum > Using Arduino > Programming Questions > ITEM FOR A SOFTAIR GAME
arduino
Comments
Post a Comment