/minitel-bitmap

Display a bitmap image on a minitel terminal

Primary LanguagePython

minitel-bitmap

This script will convert a 1-bit 80x72 bitmap image to an Arduino sketch that you can copy and paste into the Arduino IDE.

$ python3 bitmap_to_ino.py images/dadecoza.bmp
const PROGMEM byte bitmap[] = {32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,64,80,48,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,64,88,46,39,35,35,35,35,43,45,84,48,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,88,39,33,32,32,32,32,32,32,32,32,32,35,77,48,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,64,62,33,32,32,32,32,32,32,32,32,32,32,32,32,32,43,84,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,64,62,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,34,85,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,90,33,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,74,52,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,53,32,32,32,32,64,92,84,32,32,32,32,64,92,92,32,32,32,32,32,53,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,53,32,32,32,32,95,63,95,33,32,32,32,74,63,95,37,32,32,32,64,53,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,88,85,32,32,32,32,34,35,33,32,32,32,32,32,35,33,32,32,32,32,74,77,48,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,64,62,33,74,48,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,64,55,32,75,52,32,32,32,32,32,32,32,32,32,32,32,32,32,64,63,32,32,32,77,80,60,92,84,48,32,32,32,32,32,32,32,32,32,32,64,62,32,32,32,43,84,32,32,32,32,32,32,32,32,32,32,32,32,62,32,32,32,32,74,63,32,32,34,79,84,32,32,32,32,32,32,32,32,80,55,32,32,32,32,32,43,52,32,32,32,32,32,32,32,32,32,32,74,37,32,32,32,32,74,80,48,32,32,64,63,32,32,32,32,32,32,80,62,35,32,32,32,32,32,32,32,75,48,32,32,32,32,32,32,32,32,32,55,32,32,32,32,88,39,34,35,77,80,63,92,92,92,44,44,47,35,33,32,32,32,32,80,32,32,32,32,32,75,48,32,32,32,32,32,32,32,74,33,32,32,32,90,33,32,32,32,72,55,32,32,32,32,32,32,32,32,32,32,32,32,32,34,93,32,32,32,32,32,77,48,32,32,32,32,32,44,95,32,32,32,62,33,32,32,32,64,63,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,46,77,48,32,32,32,34,93,44,44,44,44,44,32,53,32,32,34,33,32,32,32,64,63,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,43,52,32,32,32,42,85,32,32,32,32,32,85,32,32,32,32,32,32,88,55,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,79,48,32,32,32,75,48,32,32,32,32,74,48,32,32,32,32,88,87,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,32,32,93,60,44,44,46,85,32,32,32,32,32,43,76,92,92,47,55,64,92,72,80,80,92,92,92,92,88,84,92,80,53,80,93,64,88,52,86,87,77,32,90,32,88,80,80,91,52,32,32,32,32,32,32,32,32,74,37,78,95,95,93,95,95,95,95,95,93,76,95,32,42,39,32,32,75,95,95,63,54,85,79,87,85,95,79,95,95,32,32,32,32,32,32,32,32,63,32,48,93,95,95,95,85,79,94,93,95,45,79,84,88,94,92,93,42,93,79,95,95,34,87,45,82,95,94,95,55,32,32,32,32,32,32,32,32,85,80,83,83,51,55,83,63,39,35,43,35,35,35,35,35,83,83,83,82,83,83,83,83,88,95,32,34,35,35,43,84,32,32};
byte buffer[960];

void setup() {
  // put your setup code here, to run once:
  Serial.begin(2400);
  delay(100);
  Serial.write(12); //cls
  Serial.write(14); //graphic character mode
  memcpy_P(buffer, bitmap, 960);
  for (int i=0; i<960; i++) {
    Serial.write(buffer[i]);
  }
  Serial.write(15); // return to text mode
}

void loop() {
  // put your main code here, to run repeatedly:
  delay(500);
}

The result ...