I'm trying a rewrite a simple class for a serial-based Wifly module shield that was written to use SoftwareSerial to communicate with the module. Since I have a Mega, I can use Serial1.
The old class used:
class WiflyClass: public SoftwareSerial {
public:
WiflyClass(int,int);
I am trying to do either:
class WiflyClass: public Serial1 { // do i really need to inherit Serial1?
class WiflyClass {
However on compilation with the first line I get:
/Users/wsanders/Documents/Arduino/libraries/WifiShieldMega/WiflyMega.h:10: error: expected class-name before '{' token
Or with the second form I get:
/Users/wsanders/Documents/Arduino/libraries/WifiShieldMega/WiflyMega.cpp:6: error: 'Serial1' is not a class or namespace (line 6 is the line where I call Serial1.begin.)
I am including <Arduino.h> in the class's cpp and .h files.
I don't really need to inherit Serial1, since there will only be once instance of my class "owning" the Serial1 port.
So, then it seems like my class is having trouble finding Serial1, but, like Serial, it should be available everywhere Arduino.h is included? My class should have no trouble finding it....
Could someone post a link to a library that uses Serial or Serial1? Their use ought to be identical since both are defined in Arduino.h....
Thanks --w