0

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: here .

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.

12
  • Is it your own code? I guess you have not properly imported the complete project. This is just a class. where are other files? the main? Or may be you have not properly installed the compiler of this IDE. Which IDE is this?
    – Mahmood
    Sep 10 '14 at 14:11
  • 1
    is it your complete class? you have not included ´BetterStream` and you are inheriting it.
    – Mahmood
    Sep 10 '14 at 14:13
  • add #include<BetterStream> before the class definition
    – Mahmood
    Sep 10 '14 at 14:19
  • @Mahmood I'm using Arduino IDE 1.0.5-r2 . It's not my own code. All of the code is at the link at the bottom, though I'll look for a main. I believe I was told to look for setup and loop to determine the ino to compile, which is in ArduCAM_OSD.ino .
    – coderRed
    Sep 10 '14 at 14:22
  • add #include"BetterStream" if it works. tell me
    – Mahmood
    Sep 10 '14 at 14:25
1

It sounds like you are missing the libraries that the project was build for. BetterStream was part of the library system of the Ardu projects at diydrones.com

Normally for Ardu projects they use a modified version (their own) of the Arduino IDE but I don't know if the Arducam project works the same way.

I think you will find a better answer over in the support forum as http://www.diydrones.com which is where Arducam comes from.

Some of the source files look like they replace libraries so it might be that you just need a different core from diyd

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy