Moderators: adafruit_support_bill, adafruit
void setup() {
String filename;
PImage img;
int i, x, y, b, lastBit;
color c;
filename = selectInput("Select image file to convert:");
img = loadImage(filename);
lastBit = img.width * img.height - 1;
img.loadPixels();
print("#define WIDTH00 ");
println(img.width);
print("PROGMEM uint8_t img00[] = {");
for(i=x=0; x<img.width; x++) {
println();
for(y=0; y<img.height; y+=8) {
print(" ");
print('B');
for(b=0; b<8; b++, i++) {
c = img.pixels[(y+b)*img.width+x];
if((c & 1) == 0) print('0');
else print('1');
}
if(i < lastBit) print(',');
}
}
println(" };");
}
void loop() {
}
void writetolcdbig( int curxcords, int curycords, char thewordbig[])
{
int tempswitch = 0;
while (thewordbig[tempswitch] != 0){
switch (thewordbig[tempswitch]) {
case '0':
glcd.fillrect(0 + curxcords, 0 + curycords, 9, 15, BLACK);
glcd.fillrect(3 + curxcords, 3 + curycords, 3, 9, WHITE);
break;
case '1':
glcd.fillrect(0 + curxcords, 0 + curycords, 9, 15, BLACK);
glcd.fillrect(0 + curxcords, 3 + curycords, 3, 9, WHITE);
glcd.fillrect(6 + curxcords, 0 + curycords, 3, 12, WHITE);
break;
case '2':
glcd.fillrect(0 + curxcords, 0 + curycords, 9, 15, BLACK);
glcd.fillrect(0 + curxcords, 3 + curycords, 6, 3, WHITE);
glcd.fillrect(3 + curxcords, 9 + curycords, 6, 3, WHITE);
break;
case '3':
glcd.fillrect(0 + curxcords, 0 + curycords, 9, 15, BLACK);
glcd.fillrect(0 + curxcords, 3 + curycords, 6, 3, WHITE);
glcd.fillrect(0 + curxcords, 9 + curycords, 6, 3, WHITE);
break;
case '4':
glcd.fillrect(0 + curxcords, 0 + curycords, 9, 15, BLACK);
glcd.fillrect(3 + curxcords, 0 + curycords, 3, 6, WHITE);
glcd.fillrect(0 + curxcords, 9 + curycords, 6, 6, WHITE);
break;
case '5':
glcd.fillrect(0 + curxcords, 0 + curycords, 9, 15, BLACK);
glcd.fillrect(3 + curxcords, 3 + curycords, 6, 3, WHITE);
glcd.fillrect(0 + curxcords, 9 + curycords, 6, 3, WHITE);
break;
case '6':
glcd.fillrect(0 + curxcords, 0 + curycords, 9, 15, BLACK);
glcd.fillrect(3 + curxcords, 3 + curycords, 6, 3, WHITE);
glcd.fillrect(3 + curxcords, 9 + curycords, 3, 3, WHITE);
break;
case '7':
glcd.fillrect(0 + curxcords, 0 + curycords, 9, 15, BLACK);
glcd.fillrect(0 + curxcords, 3 + curycords, 6, 12, WHITE);
break;
case '8':
glcd.fillrect(0 + curxcords, 0 + curycords, 9, 15, BLACK);
glcd.fillrect(3 + curxcords, 3 + curycords, 3, 3, WHITE);
glcd.fillrect(3 + curxcords, 9 + curycords, 3, 3, WHITE);
break;
case '9':
glcd.fillrect(0 + curxcords, 0 + curycords, 9, 15, BLACK);
glcd.fillrect(3 + curxcords, 3 + curycords, 3, 3, WHITE);
glcd.fillrect(0 + curxcords, 9 + curycords, 6, 6, WHITE);
break;
case 'V':
glcd.fillrect(0 + curxcords, 0 + curycords, 9, 15, BLACK);
glcd.fillrect(3 + curxcords, 0 + curycords, 3, 12, WHITE);
glcd.fillrect(0 + curxcords, 12 + curycords, 2, 3, WHITE);
glcd.fillrect(7 + curxcords, 12 + curycords, 2, 3, WHITE);
break;
case 'F':
glcd.fillrect(0 + curxcords, 0 + curycords, 9, 15, BLACK);
glcd.fillrect(3 + curxcords, 3 + curycords, 6, 3, WHITE);
glcd.fillrect(3 + curxcords, 9 + curycords, 6, 6, WHITE);
break;
case '.':
glcd.fillrect(0 + curxcords, 12 + curycords, 3, 3, BLACK);
curxcords -= 6;
break;
case 'd':
glcd.fillrect(1 + curxcords, 0 + curycords, 6, 6, BLACK);
glcd.fillrect(3 + curxcords, 2 + curycords, 2, 2, WHITE);
curxcords -= 3;
break;
case ' ':
glcd.fillrect(0 + curxcords, 0 + curycords, 6, 15, WHITE);
curxcords -= 6;
break;
case ':':
glcd.fillrect(0 + curxcords, 10 + curycords, 3, 3, BLACK);
glcd.fillrect(0 + curxcords, 4 + curycords, 3, 3, BLACK);
curxcords -= 6;
break;Return to Glowy things (LCD, LED, TFT, EL) purchased at Adafruit
Users browsing this forum: Google [Bot], mibignistinly and 8 guests