login

online now

We have 128 guests and no members online

search

 
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Trying to sort it al out.....

Trying to sort it al out..... 6 years 4 months ago #140

From your website:
In order to use the GinSing library in your Arduino application, you need only include the single header file GinSing.h, and create an instance of the C++ interface class. GinSing uses the C++ class abstraction as a simple way to organize all of its functions in a convenient manner. If you are new to C++ you can consider the operation of creating (instancing) the GinSing class as creating a portal to the functions that GinSing offers. In concrete terms, you need to have the two following lines in your code (outside of any execution loops).

#include
GinSing GS;

void setup()
{
}

void loop()
{
}



This code does not work. If I try to use it as it appears above, I get the following error from avrdude:

sketch_feb12a.cpp:1:9: error: #include expects "FILENAME" or <FILENAME>
sketch_feb12a:1: error: 'GinSing' does not name a type

Do the letters "GS" in the include command constitute an "instance" of the C++ interface class you're talking about?

Obviously, I'm a beginner and I'm sure this problem is the result of some ridiculously basic thing that I'm overlooking.

Thanks
Last Edit: 6 years 3 months ago by administrator.
The administrator has disabled public write access.

Re: Trying to sort it al out..... 6 years 4 months ago #141

Sorry for the confusion rubyfocus - There is probably an HTML formatting error that is causing the compiler error. I'll track down the textual error on the page you are referring to. The format should be:

#include <GinSing.h>
GinSing GS;

The brackets were what was lost in the formatting. You could also use double quotes - either work as long as you have included the library into your project. The first line instructs the compiler to include the constants and function definitions that are in the library. The second line constructs a c++ class from which you access the functions. The actual name of the class you make (in this case GS) could be called anything you like, such as MyGinSing, or whatever - you just access the functions myGinSing.function(). This is the same thing as doing Serial.begin(), except that you don't explicitly declare the Serial class as its done internally for other Arduino libraries.

Hopefully that clears up some of the confusion. Thanks for bringing the issue to my attetion, and please let me know if you run into any other troubles.
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 0.226 seconds