Advice on general approaches or feasibility and discussions about game design
Thu Feb 12, 2015 12:14 am
I installed the Gamebuino library, I use Mac OS X, and for some reason I cannot find where to put the 'hardware' and the 'libraries' folder. Does anyone know where to put them?
Thu Feb 12, 2015 11:17 pm
I put them at:
/Users/myusername/Documents/Arduino/hardware
and
/Users/myusername/Documents/Arduino/libraries
Fri Feb 13, 2015 2:05 pm
I do not have a 'hardware' folder in the Arduino folder. Only 'libraries' and 'sketch_feb11m' folders exist.
Fri Feb 13, 2015 3:18 pm
TheSpikeFactory wrote:I do not have a 'hardware' folder in the Arduino folder. Only 'libraries' and 'sketch_feb11m' folders exist.
I copied the "
hardware" folder from the
Gambuino-master folder to the
Arduino folder. It only contains the
Gamebuino folder, I don't know where the other hardwares are defined.
I added the contents of the
Gamebuino-master/libraries folder to the
Arduino/libraries folder. There was just a readme file in there.
Catsfolly
Fri Feb 13, 2015 10:24 pm
Even doing what you told me to do, it says this:
"sketch_feb11m.ino5:29: fatal error: Gamebuino.h: No such file or directory
compilation terminated.
Error compiling."
Sat Feb 14, 2015 1:27 am
Okay, I got it working, but now it's saying "error: expected declaration before '}' token.
What am I supposed to do now?
Sat Feb 14, 2015 1:36 am
That sounds like a code problem. Are you using an example or something home-brewed? Post an example of the code so we can see.
Sat Feb 14, 2015 1:41 am
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
}
//imports the SPI library
#include <SPI.h>
//imports the Gamebuino library
#include <Gamebuino.h>
//creates a Gamebuino object named gb
Gamebuino gb;
const byte PROGMEM sprite[] =
{
11,6,
B00011110000,
B01010100100,
B01000000100,
B00111111000,
B00010000000,
B00000100000,
};
void setup(){
gb.begin());
//display the main menu
gb.titleScreen(F("Dart Monkey Sprite"));
}
gb.sound.playTick();
//the main loop
void loop(){
if(gb.update()){
gb.display.drawBitmap(10,10,sprite);
}
}
This is the program.
Sat Feb 14, 2015 2:54 am
You have an extra parentheses right after void loop.
Also, you seem to have a totally extra void loop and void setup
This is what it should look like, but unfortunately there is still a problem with this code.
- Code:
//imports the SPI library
#include <SPI.h>
//imports the Gamebuino library
#include <Gamebuino.h>
//creates a Gamebuino object named gb
Gamebuino gb;
static unsigned char PROGMEM sprite[] =
{
11,6,
B00011110000,
B01010100100,
B01000000100,
B00111111000,
B00010000000,
B00000100000,
};
void setup(){
gb.begin());
//display the main menu
gb.titleScreen(F("Dart Monkey Sprite"));
}
gb.sound.playTick();
//the main loop
void loop(){
if(gb.update()){
gb.display.drawBitmap(11,6,sprite);
}
//This is the program.
Sat Feb 14, 2015 3:03 am
This is on the spot, but I think it works:
- Code:
#include <SPI.h> //imports the SPI library
#include <Gamebuino.h> //imports the Gamebuino library
Gamebuino gb; //creates a Gamebuino object named gb
static unsigned char PROGMEM sprite[] =
{
12,6,
B000111100000,
B010101001000,
B010000001000,
B001111110000,
B000100000000,
B000001000000,
};
void setup(){
gb.begin());
//display the main menu
gb.titleScreen(F("Dart Monkey Sprite"));
}
gb.sound.playTick();
//the main loop
void loop(){
while(true) {
if(gb.update()){
gb.display.drawBitmap(12,6,sprite);
}
}
}
//This is the program.
Powered by phpBB © phpBB Group.
phpBB Mobile / SEO by Artodia.