I'm having some trouble getting this arduino code to compile. It's not my project, but it should compile totally fine. Having never worked with the Arduino before, these errors are a bit intimidating, but I'll try to be specific enough for someone to get a guess. So...
I have this directory with these files: .
I found that the ArduCAM_OSD.ino has the loop and setup functions. When I try to compile the ino and solution I get these errors:
In file included from ArduCam_Max7456.cpp:4:
ArduCam_Max7456.h:78: error: expected class-name before '{' token
ArduCam_Max7456.h:84: error: 'uint8_t' has not been declared
ArduCam_Max7456.h:84: error: 'uint8_t' has not been declared
ArduCam_Max7456.h:87: error: 'uint8_t' has not been declared
ArduCam_Max7456.h:91: error: 'uint8_t' has not been declared
ArduCam_Max7456.h:91: error: 'uint8_t' has not been declared
ArduCam_Max7456.h:98: error: 'size_t' does not name a type
ArduCam_Max7456.h:99: error: 'uint8_t' has not been declared
ArduCam_Max7456.h:100: error: 'BetterStream' has not been declared
ArduCam_Max7456.h:102: error: 'uint8_t' does not name a type
ArduCam_Max7456.cpp: In member function 'void OSD::init()':
ArduCam_Max7456.cpp:38: error: 'video_mode' was not declared in this scope
ArduCam_Max7456.cpp: In member function 'void OSD::setMode(int)':
ArduCam_Max7456.cpp:109: error: 'video_mode' was not declared in this scope
ArduCam_Max7456.cpp:110: error: 'video_center' was not declared in this scope
ArduCam_Max7456.cpp: In member function 'int OSD::getMode()':
ArduCam_Max7456.cpp:123: error: 'video_mode' was not declared in this scope
ArduCam_Max7456.cpp: In member function 'int OSD::getCenter()':
ArduCam_Max7456.cpp:138: error: 'video_center' was not declared in this scope
ArduCam_Max7456.cpp: At global scope:
ArduCam_Max7456.cpp:162: error: prototype for 'void OSD::setPanel(uint8_t, uint8_t)' does
not match any in class 'OSD'
ArduCam_Max7456.h:84: error: candidate is: void OSD::setPanel(int, int)
ArduCam_Max7456.cpp: In member function 'void OSD::openPanel()':
ArduCam_Max7456.cpp:177: error: 'row' was not declared in this scope
ArduCam_Max7456.cpp:177: error: 'col' was not declared in this scope
ArduCam_Max7456.cpp: In member function 'void OSD::closePanel()':
ArduCam_Max7456.cpp:206: error: 'row' was not declared in this scope
ArduCam_Max7456.cpp: At global scope:
ArduCam_Max7456.cpp:212: error: prototype for 'void OSD::openSingle(uint8_t, uint8_t)' does
not match any in class 'OSD'
ArduCam_Max7456.h:91: error: candidate is: void OSD::openSingle(int, int)
ArduCam_Max7456.cpp:236: error: no 'size_t OSD::write(uint8_t)' member function declared in
class 'OSD'
ArduCam_Max7456.cpp:251: error: prototype for 'void OSD::control(uint8_t)' does not match
any in class 'OSD'
ArduCam_Max7456.h:87: error: candidate is: void OSD::control(int)
ArduCam_Max7456.cpp:268: error: prototype for 'void OSD::write_NVM(int, uint8_t*)' does not
match any in class 'OSD'
ArduCam_Max7456.h:99: error: candidate is: void OSD::write_NVM(int, int*)
The most notable of these is the first error. Here's the class, in a header file, throwing the error:
class OSD: public BetterStream
{
public:
OSD(void);
void init(void);
void clear(void);
void plug(void);
void setPanel(uint8_t start_col, uint8_t start_row);
void openPanel(void);
void closePanel(void);
void control(uint8_t ctrl);
void detectMode(void);
void setMode(int mode);
void setBrightness();
void openSingle(uint8_t x, uint8_t y);
int getMode(void);
int getCenter(void);
virtual int available(void);
virtual int read(void);
virtual int peek(void);
virtual void flush(void);
virtual size_t write(uint8_t c);
void write_NVM(int font_count, uint8_t *character_bitmap);
using BetterStream::write;
private:
uint8_t start_col, start_row, col, row, video_mode, video_center;
};
Now, since I know confidently that this should compile, I'm convinced that I've made some small syntactical error that can be fixed easily. In case anyone needs to see more of the files, you can access them all on the google code page here. Alternatively, please feel free to ask any questions.