Pages: [1]   Go Down
Author Topic: Wii Classic Controller Error  (Read 1360 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I am trying to get the Arduino Uno and the Wii Classic Remote to work and this is the error I received:


core.a(main.cpp.o): In function `main':
C:\Users\Tong\Documents\arduino-0022\hardware\arduino\cores\arduino/main.cpp:7: undefined reference to `setup'
C:\Users\Tong\Documents\arduino-0022\hardware\arduino\cores\arduino/main.cpp:10: undefined reference to `loop'

Here's code I am using.
http://www.arduino.cc/playground/Main/WiiClassicController

Please help. My project is due to 2 weeks! this is the first time I am using Arduino
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 650
Posts: 50833
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What did you do with the code in the link?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I copied and paste to the Arduino software. What are the steps I need to take?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 650
Posts: 50833
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The first block of code on that page DOES contain a setup() function and a loop() function. If you pasted that code as a sketch, and the second block of code in another tab with the correct name and .h extension, the code should compile.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I did that and it is still giving me the same error. Here's a screen print. Thank you for helping me.



* Wii.png (78.56 KB, 1152x864 - viewed 25 times.)
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 650
Posts: 50833
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Which version of the IDE are you using? I pasted the first code into the IDE (0022), and the second code into a new tab, named WiiClassic.h. The program failed to compile, but it complained only about the WiiClassic.h file. When I added
#include <WProgram.h> to the WiiClassic.h tab, the program compiled successfully.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you so much for your help. YES! It compiled now.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 650
Posts: 50833
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So, what did you have to change?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just added #include <WProgram.h>
Logged

Pages: [1]   Go Up
Jump to: