Hello,
I know im being an idiot here and the answers probably simple but i cannot see it, im trying to tidy up my sketch by creating a library so here goes with just one of the functions using Morse example as a guide.
/*
UC1608.h LCD Library for 240x128 Pannel
using UC1608 controller.
Created by S. Ruscoe 15/2/2010
*/
#include "WProgram.h"
#ifndef uc1608_h
#define uc1608_h
class UC1608
{
public:
void setbacklight(int Rval, int Gval, int Bval);
private:
int _Rval;
int _Gval;
int _Bval;
};
#endif
And the Cpp file reads
/*
UC1608.cpp LCD Library for 240x128 Pannel
using UC1608 controller.
Created by S. Ruscoe 15/2/2010
*/
#include "WProgram.h"
#include "uc1608.h"
int Rled = 9; // Red Backlight digital pin 9
int Gled = 10; // Green Backlight digital pin 10
int Bled = 11; // Blue Backlight digital pin 11
void UC1608::setbacklight(int Rval, int Gval, int Bval)
{
analogWrite(Rled, _Rval);
analogWrite(Gled, _Gval);
analogWrite(Bled, _Bval);
_Rval = Rval;
_Gval = Gval;
_Bval = Bval;
}
in my sketch
UC1608.setbacklight(0,0,128);
Gives - In function 'void setup()':
error: expected unqualified-id before '.' token
or
UC1608 setbacklight(0,0,128);
Gives - In function 'void setup()':
error: no matching function for call to 'UC1608::UC1608(int, int, int)'C:\arduino-0018\libraries\UC1608/uc1608.h:14: note: candidates are: UC1608::UC1608()
C:\arduino-0018\libraries\UC1608/uc1608.h:14: note: UC1608::UC1608(const UC1608&)
What am i doing wrong? Please
Thanks