'Serial' was not declared in this scope
hello, i'm getting following error .cpp file i'm including library i'm writing:
'serial' not declared in scope
i'm using arduino environment compile, library shows in import library menu , includes fine. file called servertaskkernel.cpp , structured follows:
and sketch includes header file is:
is there include file serial? i'm experienced programmer, new arduino. somehow arduino environment doesn't seem setting dependencies right? appreciated.
[glow]edit:[/glow] tried removing includes , pasting of library code sketch 1 file, , didn't error. has being in library, i.e., in external .h , .cpp files...
'serial' not declared in scope
i'm using arduino environment compile, library shows in import library menu , includes fine. file called servertaskkernel.cpp , structured follows:
code: [select]
#include "servertaskkernel.h"
. . .
void servertaskkernel::loop_() {
. . .
int command = serial.read();
}
and sketch includes header file is:
code: [select]
#include <task.h>
#include <servertaskkernel.h>
#define serial_speed 9600
const task* tasks[] {
};
servertaskkernel g_kernel(0, tasks);
void setup() {
serial.begin(serial_speed);
}
void loop() {
g_kernel.loop_();
}
is there include file serial? i'm experienced programmer, new arduino. somehow arduino environment doesn't seem setting dependencies right? appreciated.
[glow]edit:[/glow] tried removing includes , pasting of library code sketch 1 file, , didn't error. has being in library, i.e., in external .h , .cpp files...
i found need include serial , other arduino features:
#include "wprogram.h"
once placed in servertaskkernel, didn't complain serial anymore. if had referenced serial in header file, have had include wprogram.h there, referenced in implementation file.
i guess should have read library creation tutorial earlier
http://www.arduino.cc/en/hacking/librarytutorial
#include "wprogram.h"
once placed in servertaskkernel, didn't complain serial anymore. if had referenced serial in header file, have had include wprogram.h there, referenced in implementation file.
i guess should have read library creation tutorial earlier
http://www.arduino.cc/en/hacking/librarytutorial
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > 'Serial' was not declared in this scope
arduino
Comments
Post a Comment