forked from lmirel/MorphingClockRemix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTinyIcons.cpp
More file actions
33 lines (30 loc) · 748 Bytes
/
TinyIcons.cpp
File metadata and controls
33 lines (30 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
* mirel.lazar@gmail.com
*
* provided 'AS IS', use it at your own risk
*/
#include "TinyIcons.h"
#define DEBUG 0
#define debug_println(...) \
do { if (DEBUG) Serial.println(__VA_ARGS__); } while (0)
#define debug_print(...) \
do { if (DEBUG) Serial.print(__VA_ARGS__); } while (0)
void DrawIcon (PxMATRIX* d, int *ico, char xo, char yo, int cols, int rows)
{
debug_print ("draw icon ");
debug_print (cols);
debug_print (" x ");
debug_print (rows);
debug_print (": ");
int i, j;
for (i = 0; i < rows; i++)
{
for (j = 0; j < cols; j++)
{
d->drawPixel (xo + j, yo + i, ico[i * cols + j]);
debug_print (ico[i * cols + j]);
debug_print (", ");
}
}
debug_println ();
}