Tetris Example Trouble

Support and discussion for the Video Game Shield.

Got a cool game you wrote? Need help getting it to work?

Tetris Example Trouble

Postby MacSpinks » Thu Apr 12, 2012 8:49 pm

So I put together the video game shield and followed the instructions to install the libraries. I then opened up the tetris example and tried to upload it and got the error shown in the attached photo. Any help would be greatly appreciated! (This is going to be part of a final project for one of my classes)
Attachments
Arduino.png
Arduino.png (237.6 KiB) Viewed 1908 times
MacSpinks
 
Posts: 4
Joined: Thu Apr 12, 2012 8:42 pm

Re: Tetris Example Trouble

Postby wayne » Thu Apr 12, 2012 9:25 pm

Hi,

Can you copy and paste the entire error from the box in the bottom?

Thanks!
Adam Wolf, "Wayne" of Wayne and Layne, LLC
wayne
Wayne and Layne staff
 
Posts: 41
Joined: Thu Aug 19, 2010 10:06 am

Re: Tetris Example Trouble

Postby trodoss » Thu Apr 12, 2012 10:21 pm

@MacSpinks,
Hi there!

The title looks like "sketch_apr12a," and not "tetris" (when loading a filename like "tetris.pde" or "tetris.ino") so it might be something to do with how the code was loaded into the IDE.

The part of the error message I could see in your screenshot was "sketch_apr12a:220 error 'gameInstance' was not declared in this scope"

Based on this, it looks like the the compiler is not finding the "stc.h" and "stc.cpp" that are used by that sketch. Those should be in the same directory as the tetris code that you are trying to load.

Do you remember how you loaded the sketch, and where it was located on your PC?
Arduino Projects on Google Code: http://code.google.com/p/trodoss-arduino
trodoss
 
Posts: 52
Joined: Tue Mar 29, 2011 2:49 pm

Re: Tetris Example Trouble

Postby trodoss » Fri Apr 13, 2012 8:34 am

One thing you could try is putting the code is in your sketchbook library directory and then use "File...Sketchbook", and then the IDE will present you with all of the items in your sketchbook.

It looks like you are running Windows 7, so you probably have a folder in "Documents" (under your "LIbraries" in the filesystem) named "Arduino." You can try putting the Video Game Shield code there and see if the Arduino IDE then loads the code correctly.

Hopefully that helps.
--trodoss
Arduino Projects on Google Code: http://code.google.com/p/trodoss-arduino
trodoss
 
Posts: 52
Joined: Tue Mar 29, 2011 2:49 pm

Re: Tetris Example Trouble

Postby MacSpinks » Fri Apr 13, 2012 3:40 pm

So I downloaded the zip files and extracted them. I dragged and dropped all the folders into the Arduino :arrow: libraries folder. Then I navigated to Arduino :arrow: libraries :arrow: VideoGameHelper :arrow: examples :arrow: tetris. I then opened the tetris.pde file, tried to upload it, and got the errors in the pictures. (Sorry copy paste wont work in the IDE's console)
Attachments
Arduino1.png
part2
Arduino1.png (110.63 KiB) Viewed 1887 times
Arduino.png
part1
Arduino.png (111.68 KiB) Viewed 1887 times
MacSpinks
 
Posts: 4
Joined: Thu Apr 12, 2012 8:42 pm

Re: Tetris Example Trouble

Postby trodoss » Fri Apr 13, 2012 5:52 pm

It looks like you continue to get "[x] was not declared in this scope" as an error, which looks like the IDE cannot find the Video Game Shield libraries in their current location (the Arduino IDE folder, Libraries)

The Sketchbook libraries are usually stored in your profile, under "Documents"
There is most likely already a directory named "Arduino" there, that you should be able to up the Video Game Shield files into.
Then, if you open the Arduino IDE, and select "File...Sketchbook," you should see the directories listed, and should be able to navigate to the "tetris" sketch.
Arduino Projects on Google Code: http://code.google.com/p/trodoss-arduino
trodoss
 
Posts: 52
Joined: Tue Mar 29, 2011 2:49 pm

Re: Tetris Example Trouble

Postby MacSpinks » Sun Apr 15, 2012 7:37 pm

I figured out what was going on. The ide is not finding the .h and .cpp files that are included in the tetris example folder. All other libraries are working fine so i'm not really sure why Arduino cant find those files even though they are in the folder that the sketch is saved in.
MacSpinks
 
Posts: 4
Joined: Thu Apr 12, 2012 8:42 pm

Re: Tetris Example Trouble

Postby trodoss » Tue Apr 17, 2012 8:33 am

Great!
Glad that you were able to figure out your issue. When I have time I am going to download the latest VGS code and see if it gives me the same issue, since I haven't seen the issue you describe. It should be able to find those files if they are in the same ditrectory.
Arduino Projects on Google Code: http://code.google.com/p/trodoss-arduino
trodoss
 
Posts: 52
Joined: Tue Mar 29, 2011 2:49 pm

Re: Tetris Example Trouble

Postby MacSpinks » Thu Apr 26, 2012 11:42 pm

@tdross: Thanks for your help.

I ended up interfacing the Nintendo 64 Controller with the video game shield to control the tetris game.
If anyone wants to check out the project you can find the instructable at http://www.instructables.com/id/Video-G ... ontroller/
MacSpinks
 
Posts: 4
Joined: Thu Apr 12, 2012 8:42 pm

Re: Tetris Example Trouble

Postby trodoss » Fri Apr 27, 2012 10:56 pm

Glad to be of help, and your Instructables looks good!

The N64 is a great (and under-utilized) controller. 10 Buttons, the analog thumb stick, and a directional pad is a lot of input available. Looks like you are well on your way for your project.

--trodoss
Arduino Projects on Google Code: http://code.google.com/p/trodoss-arduino
trodoss
 
Posts: 52
Joined: Tue Mar 29, 2011 2:49 pm


Return to Video Game Shield

Who is online

Users browsing this forum: No registered users and 0 guests