error: 'Adafruit_PCD8544' does not name a type

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

error: 'Adafruit_PCD8544' does not name a type

Postby emailjakefrench » Mon Aug 13, 2012 3:49 am

Hi All,

I purchased the Nokia 5110 lcd display a while ago and I have an issue:
I’m using the Arduino Uno for this and I can get a scroll text program to work fine, but not graphics. I’m aiming to only make (say) Game of Life stuff, involving simple pixel points of the form:
void drawPixel(uint16_t x, uint16_t y, uint16_t color);


My issue is using the 'Adafruit_PCD8544' library with the screen – I’ve downloaded the library and can include the *h and *cpp files fine, but I get the error:
sketch_aug12a:12: error: 'Adafruit_PCD8544' does not name a type
During the line
Adafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3);

I think I’m doing something fundamentally wrong but can’t see what.
Sincerely and I look forward to hearing from you,

Jake

[Edit - moderator - Please use the 'code' button when submitting code]


P.s. Stripped down version:
Code: Select all
#include <Adafruit_GFX.h>
#include <Adafruit_PCD854444.h>
#include <Adafruit_PCD854444.cpp>

// pin 7 - Serial clock out (SCLK)
// pin 6 - Serial data out (DIN)
// pin 5 - Data/Command select (D/C)
// pin 4 - LCD chip select (CS)
// pin 3 - LCD reset (RST)


//Adafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3);
// also tried this but get the same result:
//Adafruit_PCD8544 display(7, 6, 5, 4, 3);


void setup()
{               
    Serial.begin(9600);
    //display.begin();          // initiate done
    //display.setContrast(50);  // change contrast for suitable viewing
    //display.display();        // show splashscreen
    //delay(2000);
    //display.clearDisplay();   // clears the screen and buffer
}


void loop()
{
 
}
emailjakefrench
 
Posts: 2
Joined: Mon Aug 13, 2012 3:40 am

Re: error: 'Adafruit_PCD8544' does not name a type

Postby adafruit_support_bill » Mon Aug 13, 2012 5:09 am

Scroll up in the diagnostic window to find the first few lines of the error messages. I suspect that is was not able to locate the library files. Most likely they are not installed in the correct location. Follow the instructions here:
http://www.ladyada.net/library/arduino/libraries.html
User avatar
adafruit_support_bill
 
Posts: 16027
Joined: Sat Feb 07, 2009 9:11 am

Re: error: 'Adafruit_PCD8544' does not name a type

Postby emailjakefrench » Mon Aug 13, 2012 2:12 pm

Sorry, I don't think I made myself clear - this is the only message displayed when I scroll up -

pcdtest:12: error: 'Adafruit_PCD8544' does not name a type

For the code (below), i.e. the libraries can be seen - I just get the above error when at this line:
Adafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3);

Best, Jake

P.s. code
#include <Adafruit_GFX.h>
#include <Adafruit_PCD8544.h>
#include <Adafruit_PCD8544.cpp>

Adafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3);
// also tried
//Adafruit_PCD8544 display(7, 6, 5, 4, 3);


void setup()
{
Serial.begin(9600);
//display.begin(); // initiate done
//display.setContrast(50); // change contrast for suitable viewing
//display.display(); // show splashscreen
//delay(2000);
//display.clearDisplay(); // clears the screen and buffer
}


void loop()
{

}
emailjakefrench
 
Posts: 2
Joined: Mon Aug 13, 2012 3:40 am

Re: error: 'Adafruit_PCD8544' does not name a type

Postby adafruit_support_rick » Mon Aug 13, 2012 2:23 pm

That error means that the IDE cannot find the Adafruit_PCD8544 library. Either you have not put the library folder in the right place, or you have not given the folder the correct name.

From the github library page:
To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder Adafruit_PCD8544. Check that the Adafruit_PCD8544 folder contains Adafruit_PCD8544.cpp and Adafruit_PCD8544.h

Place the Adafruit_PCD8544 library folder your <arduinosketchfolder>/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE.


You can also refer to the library instructions adafruit_support posted in his earlier message.

Finally, this is not correct:
Code: Select all
#include <Adafruit_PCD8544.cpp>

Do not #include .cpp files. The IDE will find them in the library.
User avatar
adafruit_support_rick
 
Posts: 2902
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY


Return to Arduino

Who is online

Users browsing this forum: No registered users and 9 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [103]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[109]
 
Wireless[14]
Cables[61]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]