Skip to content

Instantly share code, notes, and snippets.

@AlexanderSavochkin
Created July 21, 2015 05:49
Show Gist options
  • Save AlexanderSavochkin/5ac4921e5c30b50caee1 to your computer and use it in GitHub Desktop.
Save AlexanderSavochkin/5ac4921e5c30b50caee1 to your computer and use it in GitHub Desktop.
Arduino ColorShield API description
//В заголовочном файле Colorduino.h определяется структура pixelRGB,
typedef struct pixelRGB {
unsigned char r;
unsigned char g;
unsigned char b;
} PixelRGB;
//...а так же класс ColorduinoObject,
class ColorduinoObject {
...
};
//... и декларируется глобальный объект Colorduino, через который можно управлять индикатором
extern ColorduinoObject Colorduino;
//...
//Инициализируем индикатор
Colorduino.Init();
//Меняем местами экранный и внеэкранный буфер
Colorduino.FlipPage();
//Получить указатель на пиксель во внеэкранном буфере.
//Можно по этому указателю записывать
PixelRGB *p = Colorduino.GetPixel(unsigned char x,unsigned char y);
//Получить значение пикселя из отображаемого кадрового буфера
PixelRGB *p = Colorduino.GetDrawPixel(unsigned char x,unsigned char y);
//Записать пиксель во внеэкранный буфер
void Colorduino.SetPixel(unsigned char x, unsigned char y, unsigned char r, unsigned char g, unsigned char b);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment