understanding and using my library

All right so I have been trying to build a library for a game system and building library called gamebuino. I had a working set of libraries for the display but after getting a lil advice from their lead I decide bto try it that way which included merging my gfx files to my display files so intead of having a lcd_2000_7775.h and .cpp and a gfx.h and .cpp, just one of each. so I merged the four libraries int two. while doing som I mhad a couple different class thingies with LCD_2000_7775 funtions mixed with gfx functions. but now that ive created the library im not sure how to compose sketches with it.

im hoping some one can clue me into me errors and help figure this out

errors

Arduino: 1.6.11 (Windows 7), TD: 1.30-beta3, Board: "Teensy 3.2 / 3.1, Serial, 96 MHz optimize speed (overclock), US English"

BITMAP:37: error: no matching function for call to 'Display::Display()'
 Display display;

         ^

C:\Users\duhjoker\Documents\Arduino\BITMAP\BITMAP.ino:37:9: note: candidates are:

In file included from C:\Users\duhjoker\Documents\Arduino\BITMAP\BITMAP.ino:19:0:

C:\Users\duhjoker\Documents\Arduino\libraries\mylcd/DisplayRGB.h:48:3: note: Display::Display(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)

   Display(uint8_t cs,uint8_t wr ,uint8_t rs , uint8_t rest ,uint8_t pmw );

   ^

C:\Users\duhjoker\Documents\Arduino\libraries\mylcd/DisplayRGB.h:48:3: note:   candidate expects 5 arguments, 0 provided

C:\Users\duhjoker\Documents\Arduino\libraries\mylcd/DisplayRGB.h:46:3: note: Display::Display(int16_t, int16_t)

   Display(int16_t w, int16_t h);// Constructor 

   ^

C:\Users\duhjoker\Documents\Arduino\libraries\mylcd/DisplayRGB.h:46:3: note:   candidate expects 2 arguments, 0 provided

C:\Users\duhjoker\Documents\Arduino\libraries\mylcd/DisplayRGB.h:42:7: note: constexpr Display::Display(const Display&)

 class Display : public Print

       ^

C:\Users\duhjoker\Documents\Arduino\libraries\mylcd/DisplayRGB.h:42:7: note:   candidate expects 1 argument, 0 provided

C:\Users\duhjoker\Documents\Arduino\libraries\mylcd/DisplayRGB.h:42:7: note: constexpr Display::Display(Display&&)

C:\Users\duhjoker\Documents\Arduino\libraries\mylcd/DisplayRGB.h:42:7: note:   candidate expects 1 argument, 0 provided

BITMAP:40: error: redefinition of 'Display display'
 Display display(10,11,12,13,14);

                ^

BITMAP:37: error: 'Display display' previously declared here
 Display display;

         ^

BITMAP: In function 'void setup()':
BITMAP:72: error: 'class Display' has no member named 'display'
   display.display();

           ^

no matching function for call to 'Display::Display()'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

sketch

//#include "Adafruit_GFX.h"
#include "DisplayRGB.h"
#include <SPI.h>
 
 // pin definition for the UNO
#define cs   11
#define wr   10
#define rs   12 
//#define le   13 

//#define D0 9
//#define D1 8
//#define D2 7
//#define D3 6
//#define D4 5
//#define D5 4
//#define D6 3
//#define D7 2

Display display;

//DisplayRGB TFTscreen(cs,wr,rs,le);
Display display(10,11,12,13,14);

// position of the line on screen
int xPos = 0;


const byte green_square[] PROGMEM = {
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,};

// const byte *bitmap[] = {green_square};

void setup(){
  // initialize the serial port
  //TFTscreen.setdatapin(D0,D1,D2,D3,D4,D5,D6,D7);
  display.begin();

  // initialize the display
  display.display();

  // clear the screen with a pretty color
  //TFTscreen.background(250,16,200); 
}

void loop(){


display.drawBitmap(70, 70, green_square, 16, 16, 0x07E0); 
}

here is the .h

#ifndef DisplayRGB_H
#define DisplayRGB_H

#if ARDUINO >= 100
 #include "Arduino.h"
 #include "Print.h"
#else
 #include "WProgram.h"
#endif
//#include "utility/Adafruit_GFX.h"

#include <SPI.h>
#include <avr/pgmspace.h>

#include "gfxfont.h"
#include "glcdfont.c"

#define LCDWIDTH 220
#define LCDHEIGHT 176 

// 16 PREDEFINED COLORS
#define BLACK 0x0000 
#define WHITE 0xFFFF 
#define DARKGRAY 0xAD55 
#define GRAY 0x8410
#define BLUE 0x001F 
#define DARKBLUE 0x0011 
#define TURQUOISE 0x471A 
#define GREEN 0x0400 
#define FORESTGREEN 0x2444 
#define YELLOW 0xFFE0 
#define ORANGE 0xFD20 
#define PINK 0xFE19 
#define RED 0xF800 
#define PURPLE 0x8010 
#define VIOLET 0xEC1D 
#define BROWN 0xA145
#define BEIGE 0xF7BB

typedef uint16_t color;

class Display : public Print
{
	public:

		Display(int16_t w, int16_t h);// Constructor 

		Display(uint8_t cs,uint8_t wr ,uint8_t rs , uint8_t rest ,uint8_t pmw );
		//Display(uint8_t cs,uint8_t wr ,uint8_t rs , uint8_t rest );
		//Display(uint8_t cs,uint8_t wr ,uint8_t rs );
		//LCD_2000_7775(){};
		void write_spi(const uint8_t data);
		void drawPixel(int16_t x, int16_t y, uint16_t color); //gfx
		void setdatapin(uint8_t b0,uint8_t b1, uint8_t b2 , uint8_t b3, uint8_t b4, uint8_t b5, uint8_t b6, uint8_t b7);
		
		void setbracklight(uint8_t pmw);
		
		void begin();

		/////from gfx
		void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);
		void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
		void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
		void drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
		void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
		void fillScreen(uint16_t color);
		void invertDisplay(boolean i);

		void drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
		void drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, uint16_t color);
		void fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
		void fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, int16_t delta, uint16_t color);
		
		void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
		void fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
	   
		void drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);
		void fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);
		
        // from gamebuino display.h
		//void drawBitmap(int8_t x, int8_t y, const uint8_t *bitmap);
		//void drawBitmap(int8_t x, int8_t y, int8_t w, int8_t h, const uint8_t *bitmap);
		//void drawBitmap(int8_t x, int8_t y, const uint8_t *bitmap, uint8_t rotation, uint8_t flip);
		//void drawBitmap(int8_t x, int8_t y, int8_t w, int8_t h, const uint8_t *bitmap, uint8_t dx, uint8_t dy, uint8_t dw, uint8_t dh);
		
	    /////from gfx
		void drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color);
		void drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color, uint16_t bg);
		void drawBitmap(int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h, uint16_t color);
		void drawBitmap(int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h, uint16_t color, uint16_t bg);
		boolean getBitmapPixel(const uint8_t* bitmap, uint8_t x, uint8_t y);
		
		//DRAW X-BITMAP
		void drawXBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color);

		/////from display.h summoner123
		void drawTilemap(int x, int y, const uint8_t *tilemap, const uint8_t **spritesheet);
		void drawTilemap(int x, int y, const uint8_t *tilemap, const uint8_t **spritesheet, uint8_t dx, uint8_t dy, uint8_t dw, uint8_t dh);

		/////from gfx
		void drawChar(int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size);
		void setCursor(int16_t x, int16_t y);
		void setTextColor(uint16_t c);
		void setTextColor(uint16_t c, uint16_t bg);
		void setTextSize(uint8_t s);
		void setTextWrap(boolean w);
		void setRotation(uint8_t r);
		void cp437(boolean x = true);
		void setFont(const GFXfont *f = NULL);
		void getTextBounds(char *string, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h);
		void getTextBounds(const __FlashStringHelper *s, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h);

		////from gfx
#if ARDUINO >= 100
		virtual size_t write(uint8_t);
#else
		virtual void   write(uint8_t);
#endif

		int16_t height(void) const;
		int16_t width(void) const;

		uint8_t getRotation(void) const;

		// get current cursor position (get rotation safe maximum values, using: width() for x, height() for y)
		int16_t getCursorX(void) const;
		int16_t getCursorY(void) const;
		
   protected:
	const int16_t
		WIDTH, HEIGHT;   // This is the 'raw' display w/h - never changes
	int16_t
		_width, _height, // Display w/h as modified by current rotation
		cursor_x, cursor_y;
	uint16_t
		textcolor, textbgcolor;
	uint8_t
		textsize,
		rotation;
	boolean
		wrap,   // If set, 'wrap' text at right edge of display
		_cp437; // If set, use correct CP437 charset (default is off)
	GFXfont
		*gfxFont;

	boolean persistence; //disable clean() at each frame if true
	//boolean textWrap; // If set, 'wrap' text at right edge of 
	uint8_t fontSize;
	int8_t cursorX, cursorY;
	byte contrast;
	byte frameCount;

	typedef struct {       //line 171 "Public Variables   - ADD by Summoner123
		int x;                    //X coordinate                 - ADD by Summoner123
		int y;                    //Y coordinate                 - ADD by Summoner123
		const byte *spritecol;    //Sprite of object             - ADD by Summoner123
	}object;
	object solid[60];         // Matriz were saved a Sprite, X and Y cordinates of all tiles on the screen - ADD by Summoner123

	byte numcolision = 0;     //count of solid objects indacat how many tiles drawed on the screen - ADD by Summoner123

	bool flagcollision = true;

//}; //



//fuction
	private:
		void set_window(uint8_t x1,uint8_t y1,uint8_t x2,uint8_t y2);
		void write_wr_reg(uint16_t data);
		void write_wr_data(uint16_t data);
		void write_cmd(uint16_t cmd ,uint16_t data);

		#if 0 //defined(ARDUINO_ARCH_SAM)
			void write_delay();
		#else
			#define write_delay()  
		#endif
		
//value	
	//private:
	
	#if defined(ARDUINO_ARCH_SAM)
		uint32_t _cs;
		uint32_t _pmw;
		uint32_t _wr;
		uint32_t _rs;
		uint32_t _rest;
		
		volatile uint32_t *csport;
		volatile uint32_t *pmwport;
		volatile uint32_t *wrport;
		volatile uint32_t *rsport;
		volatile uint32_t *restport;
		
		uint32_t cspinmask;
		uint32_t pmwpinmask;
		uint32_t wrpinmask;
		uint32_t rspinmask;
		uint32_t restpinmask;
		
		volatile uint32_t data[8];
		volatile uint32_t datapinmask[8];
		volatile uint32_t* dataport[8];	
			
	#else
		uint8_t _cs;
		uint8_t _pmw;
		uint8_t _wr;
		uint8_t _rs;
		uint8_t _rest;
		
		volatile uint8_t *csport;
		volatile uint8_t *pmwport;
		volatile uint8_t *wrport;
		volatile uint8_t *rsport;
		volatile uint8_t *restport;
		
		uint8_t cspinmask;
		uint8_t pmwpinmask;
		uint8_t wrpinmask;
		uint8_t rspinmask;
		uint8_t restpinmask;
		
		volatile uint8_t data[8];
		volatile uint8_t datapinmask[8];
		volatile uint8_t* dataport[8];
	
	#endif
};

void Display::drawPixel(int16_t x, int16_t y, uint16_t color)
{
	set_window(x, y, x, y);
	//this->write_wr_reg(0x0022);
	//this->write_wr_data(color);
	this->write_cmd(0x22, color);
};

uint16_t RGB(uint16_t r,uint16_t g , uint16_t b);

#endif

Duhjoker:
All right so I have been trying to build a library for a game system and building library called gamebuino. I had a working set of libraries

Is there any reason not to go back to the working set?

...R

I really don't see what is so difficult to understand. You are trying to use a no-argument constructor. You have not defined a no argument constructor.

I strongly recommend that you get your delete key fixed. Instead of commenting out code, DELETE IT!

Sorry bout that but if it's still in there then I left it for reference. Once I finish the files I will clean it. I was told that I should be able to drop my new display files into the Gamebuino library with out having to change anything. So I'm supposed to first blend the 4 into 2 then get it working then add the Gamebuino parts from its display files.

Umm could part of my problem be that I haven't changed the names of the keywords in the library txt file?

Duhjoker:
could part of my problem be that I haven't changed the names of the keywords in the library txt file?

Do you mean keywords.txt? If so then no, keywords.txt is only used for keyword highlighting in the IDE. It has no effect on your code and is completely unnecessary. You can have any keywords you want in there and it will make no difference to anything except the colors of the text shown in the IDE.

All right guys im just not understanding what to do about the display does not name a type errors. Ive been looking at the tutorial for library making and im just not getting it. I also changed the name of the constructor to the name of the class and that to is giving me errors.

what do I do to make the display.xxxxxxx work with out giving me the does not name a type errors? believe ive tried everything i know so it must be something I don't. im using the same sketch above.

errors

Arduino: 1.6.11 (Windows 7), TD: 1.30-beta3, Board: "Teensy 3.2 / 3.1, Serial, 96 MHz optimize speed (overclock), US English"

In file included from C:\Users\duhjoker\Documents\Arduino\BITMAP\BITMAP.ino:18:0:

C:\Users\duhjoker\Documents\Arduino\libraries\mylcd/DisplayRGB.h:46:36: error: return type specification for constructor invalid

   void Display(int16_t w, int16_t h);// Constructor 

                                    ^

BITMAP:42: error: 'display' does not name a type
 display.display(cs,wr,rs);

 ^

BITMAP: In function 'void setup()':
BITMAP:71: error: 'display' was not declared in this scope
   display.begin();

   ^

BITMAP: In function 'void loop()':
BITMAP:83: error: 'display' was not declared in this scope
 display.drawBitmap(70, 70, green_square, 16, 16, 0x07E0); 

 ^

'display' does not name a type

sketch

#include "DisplayRGB.h"
#include <SPI.h>


 
 // pin definition for the UNO
#define cs   11
#define wr   10
#define rs   12 
//#define le   13 

//#define D0	 9
//#define D1	 8
//#define D2	 7
//#define D3	 6
//#define D4	 5
//#define D5	 4
//#define D6	 3
//#define D7	 2

//Display display;


//DisplayRGB TFTscreen(cs,wr,rs,le);
display.display(cs,wr,rs);

// position of the line on screen
int xPos = 0;


const byte green_square[] PROGMEM = {
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,};

// const byte *bitmap[] = {green_square};

void setup(){
  // initialize the serial port
  //TFTscreen.setdatapin(D0,D1,D2,D3,D4,D5,D6,D7);
  display.begin();

  // initialize the display
  display.begin();

  // clear the screen with a pretty color
  //TFTscreen.background(250,16,200); 
}

void loop(){


display.drawBitmap(70, 70, green_square, 16, 16, 0x07E0); 
}
[/code}
C:\Users\duhjoker\Documents\Arduino\libraries\mylcd/DisplayRGB.h:46:36: error: return type specification for constructor invalid

   void Display(int16_t w, int16_t h);// Constructor

This REALLY isn't rocket science. Constructors DO NOT RETURN ANYTHING.

void Display(int16_t w, int16_t h);// Constructor

void Display::Display(int16_t w, int16_t h):

Duhjoker:
All right guys im just not understanding what to do about the display does not name a type errors. Ive been looking at the tutorial for library making and im just not getting it. I also changed the name of the constructor to the name of the class and that to is giving me errors.

what do I do to make the display.xxxxxxx work with out giving me the does not name a type errors? believe ive tried everything i know so it must be something I don't. im using the same sketch above.

errors

Arduino: 1.6.11 (Windows 7), TD: 1.30-beta3, Board: "Teensy 3.2 / 3.1, Serial, 96 MHz optimize speed (overclock), US English"

In file included from C:\Users\duhjoker\Documents\Arduino\BITMAP\BITMAP.ino:18:0:

C:\Users\duhjoker\Documents\Arduino\libraries\mylcd/DisplayRGB.h:46:36: error: return type specification for constructor invalid

void Display(int16_t w, int16_t h);// Constructor

^

BITMAP:42: error: 'display' does not name a type
display.display(cs,wr,rs);

^

BITMAP: In function 'void setup()':
BITMAP:71: error: 'display' was not declared in this scope
  display.begin();

^

BITMAP: In function 'void loop()':
BITMAP:83: error: 'display' was not declared in this scope
display.drawBitmap(70, 70, green_square, 16, 16, 0x07E0);

^

'display' does not name a type




sketch


#include "DisplayRGB.h"
#include <SPI.h>

// pin definition for the UNO
#define cs  11
#define wr  10
#define rs  12
//#define le  13

//#define D0 9
//#define D1 8
//#define D2 7
//#define D3 6
//#define D4 5
//#define D5 4
//#define D6 3
//#define D7 2

//Display display;

//DisplayRGB TFTscreen(cs,wr,rs,le);
display.display(cs,wr,rs);

// position of the line on screen
int xPos = 0;

const byte green_square[] PROGMEM = {
B11111111,B11111111,
B11111111,B11111111,
B11111111,B11111111,
B11111111,B11111111,
B11111111,B11111111,
B11111111,B11111111,
B11111111,B11111111,
B11111111,B11111111,
B11111111,B11111111,
B11111111,B11111111,
B11111111,B11111111,
B11111111,B11111111,
B11111111,B11111111,
B11111111,B11111111,
B11111111,B11111111,
B11111111,B11111111,};

// const byte *bitmap[] = {green_square};

void setup(){
  // initialize the serial port
  //TFTscreen.setdatapin(D0,D1,D2,D3,D4,D5,D6,D7);
  display.begin();

// initialize the display
  display.begin();

// clear the screen with a pretty color
  //TFTscreen.background(250,16,200);
}

void loop(){

display.drawBitmap(70, 70, green_square, 16, 16, 0x07E0);
}
[/code}

May I advise you to stop using word "library"?
It is not correct description / name for what you are doing.

You are coding a class variable.

Start with declaration

class DISPLAY
{
};

Implement instance of class - instantiate it as any other variable:

DISPLAY display;

It will compile, right?
Now you want to see that for sure?
add
Serial.begin(your baud rate );
your setup function

than replace system generated , invisible, default constructor with your own

class DISPLAY
{
bool DISPLAY(void) {Serial.println("class DISPLAY default constructor ");}
};

Compile and fix the errors.
Happy coding.
Jim

than replace system generated , invisible, default constructor with your own

That is NOT the proper signature for a constructor. Constructors do NOT have a return type.

Ok im really starting to feel stupid here. on the constructor? do I even need that. the only reason I added it was because it was in the adfruit.h and .cpp, I think its just used to help the commands that go the gfx files. Neither the gamebuinos display.h source or the LCD's source contain that line in their display files.

only problem is the constructors match in the .cpp file looks to have something to do with height and width arguments. does it need a void? in the gfx file its after the public before the voids.

void Display::Display(int16_t w, int16_t h):
  WIDTH(w), HEIGHT(h)
{
  _width    = WIDTH;
  _height   = HEIGHT;
  rotation  = 0;
  cursor_y  = cursor_x    = 0;
  textsize  = 1;
  textcolor = textbgcolor = 0xFFFF;
  wrap      = true;
  _cp437    = false;
  gfxFont   = NULL;
}

ok so I made the changes to the sketch like you said but it still gives me does not name a type errors.

#include "DisplayRGB.h"
#include <SPI.h>

class Display{};

Display display;
 
 // pin definition for the UNO
#define cs   11
#define wr   10
#define rs   12 
//#define le   13 

//#define D0	 9
//#define D1	 8
//#define D2	 7
//#define D3	 6
//#define D4	 5
//#define D5	 4
//#define D6	 3
//#define D7	 2

//DisplayRGB TFTscreen(cs,wr,rs,le);
display.displayC(cs,wr,rs);

// position of the line on screen
int xPos = 0;


const byte green_square[] PROGMEM = {
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,
 B11111111,B11111111,};

// const byte *bitmap[] = {green_square};

void setup(){
  // initialize the serial port
  //TFTscreen.setdatapin(D0,D1,D2,D3,D4,D5,D6,D7);
  Serial.begin();

  // initialize the display
  display.begin();

  // clear the screen with a pretty color
  //TFTscreen.background(250,16,200); 
}

void loop(){


display.drawBitmap(70, 70, green_square, 16, 16, 0x07E0); 
}

errors

Arduino: 1.6.11 (Windows 7), TD: 1.30-beta3, Board: "Teensy 3.2 / 3.1, Serial, 96 MHz optimize speed (overclock), US English"

BITMAP:6: error: redefinition of 'class Display'
 class Display{};

       ^

In file included from C:\Users\duhjoker\Documents\Arduino\BITMAP\BITMAP.ino:3:0:

C:\Users\duhjoker\Documents\Arduino\libraries\mylcd/DisplayRGB.h:42:7: error: previous definition of 'class Display'

 class Display : public Print

       ^

BITMAP:8: error: no matching function for call to 'Display::Display()'
 Display display;

         ^

C:\Users\duhjoker\Documents\Arduino\BITMAP\BITMAP.ino:8:9: note: candidates are:

In file included from C:\Users\duhjoker\Documents\Arduino\BITMAP\BITMAP.ino:3:0:

C:\Users\duhjoker\Documents\Arduino\libraries\mylcd/DisplayRGB.h:46:3: note: Display::Display(int16_t, int16_t)

   Display(int16_t w, int16_t h);// Constructor 

   ^

C:\Users\duhjoker\Documents\Arduino\libraries\mylcd/DisplayRGB.h:46:3: note:   candidate expects 2 arguments, 0 provided

C:\Users\duhjoker\Documents\Arduino\libraries\mylcd/DisplayRGB.h:42:7: note: constexpr Display::Display(const Display&)

 class Display : public Print

       ^

C:\Users\duhjoker\Documents\Arduino\libraries\mylcd/DisplayRGB.h:42:7: note:   candidate expects 1 argument, 0 provided

C:\Users\duhjoker\Documents\Arduino\libraries\mylcd/DisplayRGB.h:42:7: note: constexpr Display::Display(Display&&)

C:\Users\duhjoker\Documents\Arduino\libraries\mylcd/DisplayRGB.h:42:7: note:   candidate expects 1 argument, 0 provided

BITMAP:26: error: 'display' does not name a type
 display.displayC(cs,wr,rs);

 ^

BITMAP: In function 'void setup()':
BITMAP:55: error: no matching function for call to 'usb_serial_class::begin()'
   Serial.begin();

                ^

C:\Users\duhjoker\Documents\Arduino\BITMAP\BITMAP.ino:55:16: note: candidate is:

In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WProgram.h:24:0,

                 from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/Arduino.h:1,

                 from C:\Users\duhjoker\AppData\Local\Temp\build992f07a7205f2e6068e030fa60c01f4c.tmp\sketch\BITMAP.ino.cpp:1:

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/usb_serial.h:74:14: note: void usb_serial_class::begin(long int)

         void begin(long) { /* TODO: call a function that tries to wait for enumeration */ };

              ^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/usb_serial.h:74:14: note:   candidate expects 1 argument, 0 provided

redefinition of 'class Display'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

.h file from above

#ifndef DisplayRGB_H
#define DisplayRGB_H

#if ARDUINO >= 100
 #include "Arduino.h"
 #include "Print.h"
#else
 #include "WProgram.h"
#endif
//#include "utility/Adafruit_GFX.h"

#include <SPI.h>
#include <avr/pgmspace.h>

#include "gfxfont.h"
#include "glcdfont.c"

#define LCDWIDTH 220
#define LCDHEIGHT 176 

// 16 PREDEFINED COLORS
#define BLACK 0x0000 
#define WHITE 0xFFFF 
#define DARKGRAY 0xAD55 
#define GRAY 0x8410
#define BLUE 0x001F 
#define DARKBLUE 0x0011 
#define TURQUOISE 0x471A 
#define GREEN 0x0400 
#define FORESTGREEN 0x2444 
#define YELLOW 0xFFE0 
#define ORANGE 0xFD20 
#define PINK 0xFE19 
#define RED 0xF800 
#define PURPLE 0x8010 
#define VIOLET 0xEC1D 
#define BROWN 0xA145
#define BEIGE 0xF7BB

typedef uint16_t color;

class Display : public Print
{
	public:

		Display(int16_t w, int16_t h);// Constructor 

		void DisplayA(uint8_t cs,uint8_t wr ,uint8_t rs , uint8_t rest ,uint8_t pmw );
		void DisplayB(uint8_t cs,uint8_t wr ,uint8_t rs , uint8_t rest );
		void DisplayC(uint8_t cs,uint8_t wr ,uint8_t rs );
		//LCD_2000_7775(){};
		void write_spi(const uint8_t data);
		void drawPixel(int16_t x, int16_t y, uint16_t color); //gfx
		void setdatapin(uint8_t b0,uint8_t b1, uint8_t b2 , uint8_t b3, uint8_t b4, uint8_t b5, uint8_t b6, uint8_t b7);
		
		void setbacklight(uint8_t pmw);
		
		void begin();

		/////from gfx
		void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);
		void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
		void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
		void drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
		void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
		void fillScreen(uint16_t color);
		void invertDisplay(boolean i);

		void drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
		void drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, uint16_t color);
		void fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);
		void fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername, int16_t delta, uint16_t color);
		
		void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
		void fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color);
	   
		void drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);
		void fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color);
		
        // from gamebuino display.h
		//void drawBitmap(int8_t x, int8_t y, const uint8_t *bitmap);
		//void drawBitmap(int8_t x, int8_t y, int8_t w, int8_t h, const uint8_t *bitmap);
		//void drawBitmap(int8_t x, int8_t y, const uint8_t *bitmap, uint8_t rotation, uint8_t flip);
		//void drawBitmap(int8_t x, int8_t y, int8_t w, int8_t h, const uint8_t *bitmap, uint8_t dx, uint8_t dy, uint8_t dw, uint8_t dh);
		
	    /////from gfx
		void drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color);
		void drawBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color, uint16_t bg);
		void drawBitmap(int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h, uint16_t color);
		void drawBitmap(int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h, uint16_t color, uint16_t bg);
		boolean getBitmapPixel(const uint8_t* bitmap, uint8_t x, uint8_t y);
		
		//DRAW X-BITMAP
		void drawXBitmap(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color);

		/////from display.h summoner123
		void drawTilemap(int x, int y, const uint8_t *tilemap, const uint8_t **spritesheet);
		void drawTilemap(int x, int y, const uint8_t *tilemap, const uint8_t **spritesheet, uint8_t dx, uint8_t dy, uint8_t dw, uint8_t dh);

		/////from gfx
		void drawChar(int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size);
		void setCursor(int16_t x, int16_t y);
		void setTextColor(uint16_t c);
		void setTextColor(uint16_t c, uint16_t bg);
		void setTextSize(uint8_t s);
		void setTextWrap(boolean w);
		void setRotation(uint8_t r);
		void cp437(boolean x = true);
		void setFont(const GFXfont *f = NULL);
		void getTextBounds(char *string, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h);
		void getTextBounds(const __FlashStringHelper *s, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h);

		////from gfx
#if ARDUINO >= 100
		virtual size_t write(uint8_t);
#else
		virtual void   write(uint8_t);
#endif

		int16_t height(void) const;
		int16_t width(void) const;

		uint8_t getRotation(void) const;

		// get current cursor position (get rotation safe maximum values, using: width() for x, height() for y)
		int16_t getCursorX(void) const;
		int16_t getCursorY(void) const;
		
   protected:
	const int16_t
		WIDTH, HEIGHT;   // This is the 'raw' display w/h - never changes
	int16_t
		_width, _height, // Display w/h as modified by current rotation
		cursor_x, cursor_y;
	uint16_t
		textcolor, textbgcolor;
	uint8_t
		textsize,
		rotation;
	boolean
		wrap,   // If set, 'wrap' text at right edge of display
		_cp437; // If set, use correct CP437 charset (default is off)
	GFXfont
		*gfxFont;

	boolean persistence; //disable clean() at each frame if true
	//boolean textWrap; // If set, 'wrap' text at right edge of 
	uint8_t fontSize;
	int8_t cursorX, cursorY;
	byte contrast;
	byte frameCount;

	typedef struct {       //line 171 "Public Variables   - ADD by Summoner123
		int x;                    //X coordinate                 - ADD by Summoner123
		int y;                    //Y coordinate                 - ADD by Summoner123
		const byte *spritecol;    //Sprite of object             - ADD by Summoner123
	}object;
	object solid[60];         // Matriz were saved a Sprite, X and Y cordinates of all tiles on the screen - ADD by Summoner123

	byte numcolision = 0;     //count of solid objects indacat how many tiles drawed on the screen - ADD by Summoner123

	bool flagcollision = true;

//}; //



//function
	private:
		void set_window(uint8_t x1,uint8_t y1,uint8_t x2,uint8_t y2);
		void write_wr_reg(uint16_t data);
		void write_wr_data(uint16_t data);
		void write_cmd(uint16_t cmd ,uint16_t data);

		#if 0 //defined(ARDUINO_ARCH_SAM)
			void write_delay();
		#else
			#define write_delay()  
		#endif
		
//value	
	//private:
	
	#if defined(ARDUINO_ARCH_SAM)
		uint32_t _cs;
		uint32_t _pmw;
		uint32_t _wr;
		uint32_t _rs;
		uint32_t _rest;
		
		volatile uint32_t *csport;
		volatile uint32_t *pmwport;
		volatile uint32_t *wrport;
		volatile uint32_t *rsport;
		volatile uint32_t *restport;
		
		uint32_t cspinmask;
		uint32_t pmwpinmask;
		uint32_t wrpinmask;
		uint32_t rspinmask;
		uint32_t restpinmask;
		
		volatile uint32_t data[8];
		volatile uint32_t datapinmask[8];
		volatile uint32_t* dataport[8];	
			
	#else
		uint8_t _cs;
		uint8_t _pmw;
		uint8_t _wr;
		uint8_t _rs;
		uint8_t _rest;
		
		volatile uint8_t *csport;
		volatile uint8_t *pmwport;
		volatile uint8_t *wrport;
		volatile uint8_t *rsport;
		volatile uint8_t *restport;
		
		uint8_t cspinmask;
		uint8_t pmwpinmask;
		uint8_t wrpinmask;
		uint8_t rspinmask;
		uint8_t restpinmask;
		
		volatile uint8_t data[8];
		volatile uint8_t datapinmask[8];
		volatile uint8_t* dataport[8];
	
	#endif
};

void Display::drawPixel(int16_t x, int16_t y, uint16_t color)
{
	set_window(x, y, x, y);
	//this->write_wr_reg(0x0022);
	//this->write_wr_data(color);
	this->write_cmd(0x22, color);
};

uint16_t RGB(uint16_t r,uint16_t g , uint16_t b);

#endif

Edit ok I removed the void from in front of the constructor and it quit giving me those errors If I go class display{} at the top then I also quit getting the type errors but now I get expected un-qualified ID before "." On all the commands. If I add the Display display; under it I get the type errors again.

I've also noticed that a lot of my Display placers in the cpp have lost thier light blue color and those give not declared in the this scope errors when I try to run them in the sketch

I still need to know the above fix for my errors but.......

Ok scratch all of that. It says understand and using my library so it's gonna be about that. Yes I realize a library is collection function files or source code files.

New plan is to actually create a library with its own source code files for stuff like sound and fonts. I already have the display and fonts files from me updating my LCD's GFX files so it works with my teensy and since I'm using a teensy every things gonna be different anyway so I think it would be easier to just create my own Gamebuino library with the needed files built and included by me. So I need to create a few files that will be needed in order to build the gaming library. The Gamebuino utilizes these files..........Sound, backlight, buttons and a battery.

The backlight command is actually in the display library and can be controlled in sketch or through a settings file but I think it would be better to just set it for a normal mode.

So as the sound and battery are trivial at this point I think I should start with buttons so I can control all those sprites that can now be made by my display files.

class Display{};

That's a rather useless class, there.

Ok according to to teensy this is how set up a pin to use the pull-up resistor for the buttons.....

void setup()   {                
  Serial.begin(38400);
  pinMode(8, INPUT_PULLUP);
}

The only problem is that I want these commands in my source. I have a settings file that defines the pins used for buttons that I can easily amend but where would I put this code? In the buttons files or the settings file.

where would I put this code? In the buttons files or the settings file.

pinMode() calls can go anywhere, as long as they are in a function. So, put them wherever it makes sense.

hmmmmm I as just looking at the gamebuinos buttons.cpp and found this.......

void Buttons::update() {
    for (uint8_t thisButton = 0; thisButton < NUM_BTN; thisButton++) {
        pinMode(pins[thisButton], INPUT_PULLUP); //enable internal pull up resistors
        if (digitalRead(pins[thisButton]) == LOW) { //if button pressed
            states[thisButton]++; //increase button hold time
        } else {
            if (states[thisButton] == 0)//button idle
                continue;
            if (states[thisButton] == 0xFF)//if previously released
                states[thisButton] = 0; //set to idle
            else
                states[thisButton] = 0xFF; //button just released
        }
        pinMode(pins[thisButton], INPUT); //disable internal pull up resistors to save power
    }
	

}

it looks like the pinmode has been included in the function so all I need to do is define the extra buttons in the settings file

Everything seems to be pretty straight forward. I dropped in the sound and buttons. For the buttons I just added them to the settings file and changed the pin for sound. Changed the display define in Gamebuino to include the new DisplayRGB.h files and some other tweaks.

SPI question.... C

Both my LCD and the original Nokia5110 uses SPI. Even uses almost the same pins. Can I use the gamebuinos SPI programming instead of the LCD's.