Pages: [1]   Go Down
Author Topic: library issues  (Read 873 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 117
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, so i have tried to download a library from;http://www.wayneandlayne.com/projects/video-game-shield/download/. Now I made a library folder in sketchbook and put the library in there. Now win I open arduino it says;
The library "VideoGameShieldLibraries-2012-09-01-2" cannot be used. Libraries names can only contain basic numbers and letters.

How do i fix this?
thanks
Logged

South Louisiana
Offline Offline
Full Member
***
Karma: 0
Posts: 178
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Change the name. It's telling you that you can't have dashes in the folder name.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 117
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

how do you do that?
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 117
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

wait I got it. Now when I try and run the nunchuck demo this error appears;
Nunchuck does not have a name

Code:
/*
   Arduino sketch to demonstrate interfacing with a Nintendo Wii Nunchuck. It will print the nunchuck information from P1 every second, to the serial terminal at 9600 baud.
   Created by Adam Wolf and Matthew Beckler
   Wayne and Layne, LLC - http://wayneandlayne.com/projects/video-game-shield/
   Recent updates:
        August 18, 2012 - Changed file extension to .ino for Arduino 1.0

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License along
   with this program; if not, write to the Free Software Foundation, Inc.,
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

*/

#include <i2cmaster.h>
#include <nunchuck.h>

Nunchuck nunchuck;

void setup()
{
  nunchuck.begin(NUNCHUCK_PLAYER_1);
  Serial.begin(9600);
}

void loop()
{
  nunchuck.update();
  Serial.println("Nunchuck values:");
  Serial.println("Joystick:"); 
  Serial.print("x: "); Serial.println(nunchuck.joy_x(), DEC);
  Serial.print("y: "); Serial.println(nunchuck.joy_y(), DEC);
 
  Serial.println("Accelerometer:");
  Serial.print("x: "); Serial.println(nunchuck.acc_x(), DEC);
  Serial.print("y: "); Serial.println(nunchuck.acc_y(), DEC);
  Serial.print("z: "); Serial.println(nunchuck.acc_z(), DEC);

  Serial.println("Buttons:");
 
  Serial.print("c: ");
  if (nunchuck.button_c())
  {
    Serial.println("pushed");
  }
  else
  {
    Serial.println("not pushed");
  }
 
  Serial.print("z: ");
  if (nunchuck.button_z())
  {
    Serial.println("pushed");
  }
  else
  {
    Serial.println("not pushed");
  }
 
  delay(1000);
}
how do I fix this?
Logged

South Louisiana
Offline Offline
Full Member
***
Karma: 0
Posts: 178
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's not an error. It's an example sketch.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 117
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok, well still how do I change this so i can run it?
 
Logged

South Louisiana
Offline Offline
Full Member
***
Karma: 0
Posts: 178
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Start by posting the error you are actually getting.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 117
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok here it is


nunchuck_demo:26: error: 'Nunchuck' does not name a type
nunchuck_demo.cpp: In function 'void setup()':
nunchuck_demo:30: error: 'nunchuck' was not declared in this scope
nunchuck_demo:30: error: 'NUNCHUCK_PLAYER_1' was not declared in this scope
nunchuck_demo.cpp: In function 'void loop()':
nunchuck_demo:36: error: 'nunchuck' was not declared in this scope

I think I didn't set up the library right.
Logged

South Louisiana
Offline Offline
Full Member
***
Karma: 0
Posts: 178
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

go here and go down to contributed libraries and see if you are doing is like this.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 117
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok yeh I did that and the library shows up in the contributed library parts but it still says the same error
Logged

South Louisiana
Offline Offline
Full Member
***
Karma: 0
Posts: 178
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just went and installed the libraries. Examples compiles fine for me.

In your libraries folder did you leave the libraries in a "VideoGame"ShielLibraries" folder or did you just move the libraries into the folder individually?

what i have is ...\arduino-1.0.1\libraries\Nunchuck
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 117
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I moved the entire folder in. Not each individually
Logged

South Louisiana
Offline Offline
Full Member
***
Karma: 0
Posts: 178
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Put them individually as i have. Mine compiles fine and your should too once the IDE can find nunchuck.h
Logged

Pages: [1]   Go Up
Jump to: