Hello everybody
good day.
currently i have a problem while implement Print function to my library
here is the code that i've written please take a look.
after add them and run the sketch, it gave me this
sketch_mar19a.ino:3:11: error: cannot declare variable 'lcd' to be of abstract type 'homephone'
In file included from sketch_mar19a.ino:1:0:
C:\Program Files (x86)\Arduino\libraries\homephone/homephone.h:28:7: note: because the following virtual functions are pure within 'homephone':
class homephone:public Print {
^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:224,
from C:\Program Files (x86)\Arduino\libraries\homephone/homephone.h:2,
from sketch_mar19a.ino:1:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:48:20: note: virtual size_t Print::write(uint8_t)
virtual size_t write(uint8_t) = 0;
^
cannot declare variable 'lcd' to be of abstract type 'homephone'
i also refer to this topic with Print class and follow it.
http://playground.arduino.cc/Code/Printclass
here is my code to include my library
#include <homephone.h>
homephone lcd(9,8,7,6,5);
void setup(){
lcd.begin();
lcd.setContrast(0x12);
lcd.display();
lcd.clearDisplay();
pls help me on this issue ![]()
thank you a lot.
homephone.h (1.69 KB)
homephone.cpp (13.5 KB)