st7735 160 на 128 подсветка барахлит

andriano
andriano аватар
Offline
Зарегистрирован: 20.06.2015

andycat пишет:
...В 16 битном цвете 128 на 160 влезет 3 картинки. Учитывая ваши мультяшные картинки, то 4х цветных более чем хватит...
Вообще-то есть еще и алгоритмы сжатия картинок. И, кстати, эти алгоритмы используются в форматах *.gif, *.pcx или даже *.bmp (это для относительно простых алгоритмов, естественно *.jpg никто на AVR использовать не будет). Так что, если интересует именно уменьшение используемого места, то, вероятно, применение простых алгоритмов сжатия поможет.

andriano
andriano аватар
Offline
Зарегистрирован: 20.06.2015

andycat пишет:

ну нет....

4 цвета - в каждом байте картинке, т е в каждом пикселе, младшие 2 бита указывают номер цвета в палитре:

const unsigned char pal2bpp[] PROGMEM={ // palitra RGB565 2 bits per pixel 4 colors
  0x00, 0x00,
  0xFF, 0xFF,
  0x6B, 0x0A,
  0xD5, 0x51
};

соответственно в 16 цветной картинке в каждом байте младшие 4 бита указывают на цвет в палитре:

const unsigned char pal4bpp[] PROGMEM = { // palitra RGB565 4 bits per pixel 16 colors
  0x00, 0x00,
  0xFF, 0xFF,
  0x6B, 0x0A,
  0x7B, 0xAD,
  0x73, 0x8C,
  0x73, 0x4B,
  0x18, 0xA1,
  0xDE, 0x35,
  0x62, 0xC9,
  0xD5, 0x50,
  0x20, 0xE3,
  0xBC, 0x6D,
  0x39, 0x63,
  0x51, 0xE5,
  0xA3, 0x69,
  0x7A, 0x87
};

 

А как генерируется палитра?

Строки 2 и 3 заставляют заподозрить, что не совсем оптимально.

И еще: при уменьшении глубины цвета используется один из двух приемов: дизеринг и округление, причем генерация оптимальной палитры для них должна осуществляться по различным алгоритмам. На приведенных картинках используется дизеринг.

Но я тут упоминал о сжатии: сжиматься, конечно, лучше будет картинка с округлением. Причем, возможно, меньший размер получится даже у картинки с большей глубиной цвета.

andycat
andycat аватар
Offline
Зарегистрирован: 07.09.2017

andriano ,
- палитра рисуется руками, в фотошопе, в коде, в паинте, да где угодно
- оптимизация/упаковка изображения имеет смысл при мощном / жирном МК, тут задача сделать простенькую игрушку, времен 80х годов.
- ваши умные слова про глубины цветов это конечно хорошо, но для персоналок. для МК имеет смысл максимально приготовить контент к выводу на отображаемое устройство
ЗЫ. В 90е годы мы успешно без интернета, умных книжек, фотошопа и прочих благ нынешней цивилизации сами придумывали и писали алгоритмы масштабирования/оптимизации улучшения изображений и прекрасно их применяли. Так что ваши комментарии, извините, не к месту.

andriano
andriano аватар
Offline
Зарегистрирован: 20.06.2015

Я позволил себе пронуммеровать пункты в цитате, чтобы было понятно, к чему относятся ответы.

andycat пишет:
andriano ,

1.- палитра рисуется руками, в фотошопе, в коде, в паинте, да где угодно

2- оптимизация/упаковка изображения имеет смысл при мощном / жирном МК, тут задача сделать простенькую игрушку, времен 80х годов.

3- ваши умные слова про глубины цветов это конечно хорошо, но для персоналок. для МК имеет смысл максимально приготовить контент к выводу на отображаемое устройство

4 ЗЫ. В 90е годы мы успешно без интернета, умных книжек, фотошопа и прочих благ нынешней цивилизации сами придумывали и писали алгоритмы масштабирования/оптимизации улучшения изображений и прекрасно их применяли. Так что ваши комментарии, извините, не к месту.

1. Вообще говоря, палитра должна быть оптимизирована под конкретный рисунок или группу рисунков. Совершенно непонятно, как этого можно достичь "руками".

2. Вот как раз в 80-х упаковка/сжатие изображения применялась очень широко, с чего бы это? (напомню, что типичный ПК имел 64К памяти и 2 МГц процессор при минимум 4 такта на инструкцию, тогда как avr328 - 2К памяти и 16 МГц при 1 такте на инструкцию. Т.е. соотношение производительность_процессора/объем_памяти на тогдашних ПК было примерно в 1000 раз хуже, чем сегодня на avr).

3.1. см. 2.

3.2. У этой темы уже 11 страниц и больше половины из них посвящены тому, как хранить в памяти 1-2-3-4 бита на пиксель, а при выводе перекодировать в 16 бит на пиксель. Т.е. сама тема опровергает Ваше утверждение.

4. А почему, собственно, не к месту? Если уж даже в 90-е этим уже занимались - "без интернета, умных книжек, фотошопа и прочих благ", то сейчас уж сам Бог велел.

andycat
andycat аватар
Offline
Зарегистрирован: 07.09.2017

поставил плюсик :)

соглашусь, но ТСу надо попроще и чтоб быстро. Ну а по поводу AVR, если б у него оперативки было побольше, хотя бы как в спектруме, чтоб ворочать/сжимать/разжимать/конвертировать картинки, то вопросов бы не было, приходиться работать с тем что есть. Даже вшивый спрайтик 32*32*16бит в оперативку не влезет :(

Update: впрочем это мысль, нарисовать online преобразование картинок/цветов с непосредственным выводом на экран, займусь как нибудь.

lilik
Offline
Зарегистрирован: 19.10.2017

andriano пишет:

 

1. Вообще говоря, палитра должна быть оптимизирована под конкретный рисунок или группу рисунков. 

 

Это путаница возникла из-за двух встречных подходов в теме. Первый это раскрашивание чёрно-белых картинок разными цветами. Второй, это попытка экономного хранения и вывода на экран "полноцветных фото" с возможно их меньшей экзекуцией.  

lilik
Offline
Зарегистрирован: 19.10.2017

andriano пишет:

lilik пишет:

andriano пишет:

 

Естественно, весь пиксель - в одном единственном месте, собирать его по частям из разных мест - решение, мягко говоря, странное.

 

Согласен, поэтому 128*480 :)

То есть вот это:

{ byte_r = pgm_read_byte(bitmap + j * byteWidth + i / 8);byte_g = pgm_read_byte(bitmap + (j+160) * byteWidth + i / 8);byte_b = pgm_read_byte(bitmap + (j+320) * byteWidth + i / 8);}

не по частям из трех разных мест?

:)

Из трёх не совсем разных мест.

Просто дёргать сразу 2-4 бита из байта не очень могу пока.

andriano
andriano аватар
Offline
Зарегистрирован: 20.06.2015

andycat пишет:

Даже вшивый спрайтик 32*32*16бит в оперативку не влезет :(

Насколько я помню, все простые алгоритмы сжатия для картинок не выходят за пределы одной строки.

Т.е. для описанного случая достаточно 64 байтов. Раскодируем такими кусочками и отправляем на экран.

andriano
andriano аватар
Offline
Зарегистрирован: 20.06.2015

lilik пишет:

Просто дёргать сразу 2-4 бита из байта не очень могу пока.

Религия не позволяет?

lilik
Offline
Зарегистрирован: 19.10.2017

andriano пишет:

lilik пишет:

Просто дёргать сразу 2-4 бита из байта не очень могу пока.

Религия не позволяет?

Да, нет, просто тяжко с &,>>,| с битовыми операциями, альтернативы использую редко. Ну и первое направление мне интересней, особенно алгоритмы сжатия массивов "бит-пиксель":)

andriano
andriano аватар
Offline
Зарегистрирован: 20.06.2015

lilik пишет:

Да, нет, просто тяжко с &,>>,| с битовыми операциями, альтернативы использую редко. Ну и первое направление мне интересней, особенно алгоритмы сжатия массивов "бит-пиксель":)

Не понимаю, как можно что-то сделать, пользуясь инструментом, которым не умеешь пользоваться. Это все равно, как пытаться писать стихи, зная не все буквы.

IMHO сначала нужно освоить инструмент (хотя бы в минимальной мере), и только потом что-то пытаться при помощи него сделать.

 

lilik
Offline
Зарегистрирован: 19.10.2017

:)

Стихи можно без букв, сочинять. Писать не обязательно, правда память должна быть хорошая. 

andycat
andycat аватар
Offline
Зарегистрирован: 07.09.2017

andriano, тема в Песочнице, пусть человек развлекается :)

lilik
Offline
Зарегистрирован: 19.10.2017

andycat пишет:

andriano, тема в Песочнице, пусть человек развлекается :)

Я не развлекаюсь, а ищу и проверяю доступные мне варианты.

К примеру на этой картинке я чётко вижу, что алгоритм RLE даст существенную экономию памяти при её хранении, однако запрос "скетч для сжатия-распаковки массива данных по RLE" ничего не даёт.

andycat
andycat аватар
Offline
Зарегистрирован: 07.09.2017

А зачем её сжимать? Экономить надо когда памяти не хватает, однобитная эта картинка зацмер 2.5 КБ, т е если их10 и больше, тогда стОит заморачиваться.
А алгоритм примитивный, берете строку 128 бит, считаете подряд идущие единички, заиисываете количество и 1,потом нолики, количество и ноль и т д

andriano
andriano аватар
Offline
Зарегистрирован: 20.06.2015

lilik пишет:

однако запрос "скетч для сжатия-распаковки массива данных по RLE" ничего не даёт.

Это потому, что Вы запрос неправильно формулируете. Нужно писать не "скетч", а "алгоритм".

lilik
Offline
Зарегистрирован: 19.10.2017

С другой стороны на такой картинке алгоритм даст проигрыш, а не экономию.

andycat
andycat аватар
Offline
Зарегистрирован: 07.09.2017

Поэтому и выбираются решения, которые просто работают и те что умеет разработчик.

lilik
Offline
Зарегистрирован: 19.10.2017

Дизеринг тоже своеобразная штука, трудно сказать лучше с ним или без него.

lilik
Offline
Зарегистрирован: 19.10.2017

Сделал игру. Скорости отрисовки хватает вполне, правда с ухищрением при движении картинок:

Если пренебрегать заставкой игры, то влазит в про мини 168.

// игра канонир
#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>
#define TFT_CS     10
#define TFT_RST    9  
#define TFT_DC     8
 Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS,  TFT_DC, TFT_RST);

extern const unsigned char ris_1[];
extern const unsigned char ris_2[];
extern const unsigned char ris_3[];
extern const unsigned char ris_4[];
long Yk=0;//переменная хранения моментов времени
long Yj=0;//переменная хранения моментов времени
int i=0;// счётчик-переменная хранения положения корабля
int k=1;//
byte tt=1;//переменная задающая скорость движения корабля
int X=20;//счётчик-переменная хранения положения ядра
byte Nk=0;//
byte Nj=0;//

void setup(void) {
  digitalWrite(2, HIGH);// включить подтягивающий резистор для кнопки 
  // Используйте этот инициализатор, если вы используете 1,8-дюймовый TFT
 tft.initR(INITR_BLACKTAB);   // initialize a ST7735S chip, black tab
 //
 tft.fillScreen(tft.Color565(0,55,255));// фон моря
 tft.fillRect(80,0,48,160,tft.Color565(0,255,255));//фон неба
 tft.fillRect(0,65,5,30,tft.Color565(0,0,0));tft.fillRect(0,75,20,10,tft.Color565(0,0,0));//пушка
for(int j=0;j<9;j++){drawBitmap_(5,8*j,ris_3,16,8,2);}//обойма ядер рисуется
//
 tft.setRotation(0);//ориентация экрана
 }
void loop() {
  //
 if(millis()-Yk>7*tt){//гоняем кораблик - мишень вдоль горизонта 
 Yk=millis();i=i+k;if(k==1){drawBitmap_(80,i,ris_1,48,48,1);}if(k==-1){drawBitmap_(80,i,ris_2,48,48,1);}
 if(i==112){k=-1;tft.fillRect(X,75,16,8,tft.Color565(0,55,255));X=20;delay(500*tt);tt=random(2,8);}
 if(i==0){k=1;tft.fillRect(X,75,16,8,tft.Color565(0,55,255));X=20;delay(500*tt);tt=random(2,8);}
 }
 if(millis()-Yj>5&&X>=21&&X<=60){Yj=millis();drawBitmap_(X,75,ris_3,16,8,2);X=X+2;}//рисуем полёт ядра если был выстрел
 
 if(digitalRead(2)==LOW){//производим выстрел по нажатию кнопки
  Nj++;if(Nj>9){Nj=0;for(int j=0;j<9;j++){drawBitmap_(5,8*j,ris_3,16,8,2);}}tft.fillRect(5,8*Nj-8,16,8,tft.Color565(0,55,255));//расход обоймы ядер рисуем
  tft.fillRect(X,75,16,8,tft.Color565(0,55,255));X=21;delay(150);
  }
 
 if(X>60){//если ядро попало то рисуем обломки корабля, а если  долетело стираем его изображение
  tft.fillRect(X,75,16,8,tft.Color565(0,55,255));
  if(i>50&&i<60){drawBitmap_(80,i,ris_4,48,48,1);delay(1000);Nk++;if(Nk>4){Nk=0;tft.fillRect(8*Nk-8,105,80,48,tft.Color565(0,55,255));}drawBitmap_(8*Nk-8,105,ris_1,48,48,2);}X=20;//условие попадания в цель
  }
 //
}
/////////////////////////////////////////////////////////////////////
void drawBitmap_(int x,int y, const uint8_t *bitmap,int w,int h,byte pal) {//функция вывода 4-х цветного рисунка по координатам, заданного размера и выбранной палитры
if(x<0||x+w>128||y<0||y+h>160){return;} 
 tft.setAddrWindow(x,y,x+w-1,y+h-1);
 int i, j, byteWidth = (w + 7) / 8;
  uint8_t byte_r;uint8_t byte_g;uint8_t byte_b;
   //
  SPI.beginTransaction(SPISettings(8000000, MSBFIRST, SPI_MODE0));
  digitalWrite(TFT_DC, HIGH);
  digitalWrite(TFT_CS, LOW); 
 for(j=0; j<h; j++) {
    for(i=0; i<w; i++) {
      if(i & 7) {byte_r <<= 1;byte_g <<= 1;}
      else     { byte_r = pgm_read_byte(bitmap + j * byteWidth + i / 8);byte_g = pgm_read_byte(bitmap + (j+h) * byteWidth + i / 8);}
      if((byte_r&0x80)&&(byte_g&0x80))
      {if(pal==1){SPI.transfer(tft.Color565(50,50,50)>>8);SPI.transfer(tft.Color565(50,50,50));}if(pal==2){SPI.transfer(tft.Color565(0,0,0)>>8);SPI.transfer(tft.Color565(0,0,0));}}
      if(!(byte_r&0x80)&&!(byte_g&0x80))
      {if(pal==1){SPI.transfer(tft.Color565(0,255,255)>>8);SPI.transfer(tft.Color565(0,255,255));}if(pal==2){SPI.transfer(tft.Color565(0,55,255)>>8);SPI.transfer(tft.Color565(0,55,255));}}
      if((byte_r&0x80)&&!(byte_g&0x80))
      {if(pal==1){SPI.transfer(tft.Color565(255,0,0)>>8);SPI.transfer(tft.Color565(255,0,0));}if(pal==2){SPI.transfer(tft.Color565(255,100,0)>>8);SPI.transfer(tft.Color565(255,100,0));}}
      if(!(byte_r&0x80)&&(byte_g&0x80))
      {if(pal==1){SPI.transfer(tft.Color565(250,250,0)>>8);SPI.transfer(tft.Color565(250,250,0));}if(pal==2){SPI.transfer(tft.Color565(250,250,250)>>8);SPI.transfer(tft.Color565(250,250,250));}}
      
    }
  }
  digitalWrite(TFT_CS, HIGH);
  SPI.endTransaction();
 ///  
}
/////////////////////////////////////////////////////////////////////
#include <avr/pgmspace.h>


const unsigned char ris_1[]PROGMEM = {//корабль вправо
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0X60,0X18,0X00,0X00,0X00,0X3E,
0X7C,0X30,0XC0,0X00,0X00,0X3E,0X6C,0X21,0XE0,0X00,0X00,0X7C,0XC7,0X3F,0XFF,0X00,
0X00,0XE8,0XFF,0XFF,0XE6,0X00,0X03,0X96,0XE7,0XC1,0XC6,0X00,0X0F,0X9E,0XE3,0XC0,
0X46,0X00,0X1E,0X12,0XE3,0X80,0X06,0X00,0X1C,0X16,0XE7,0X80,0X06,0X00,0X3C,0X9E,
0XE7,0X00,0X00,0X00,0X34,0X96,0XE6,0X00,0X00,0X00,0X24,0X96,0XC6,0X04,0X00,0X80,
0X24,0X99,0X04,0X1E,0X03,0X80,0X24,0XB1,0XE4,0XFD,0XFF,0X00,0X2C,0XE7,0XFF,0XF9,
0XFF,0X00,0X2C,0XCE,0X7F,0X88,0XFE,0X00,0X2C,0X9C,0X63,0X88,0XFE,0X9E,0X2C,0X98,
0X63,0XD8,0XFF,0XFE,0X2C,0XBB,0X7A,0X1F,0XFE,0X9E,0X2C,0XBF,0XFD,0X98,0X7E,0X9E,
0X24,0XA1,0X31,0X98,0X7F,0X9E,0X24,0XA0,0X30,0X1A,0X7F,0X9C,0X24,0XA0,0XB1,0X98,
0XFF,0X9C,0X24,0XB0,0XBC,0X2E,0XFE,0X1C,0X24,0XD0,0XBD,0XCC,0XFC,0X1C,0X24,0X98,
0XF3,0XF8,0X00,0X00,0X24,0X40,0XFB,0XF0,0X00,0X00,0X16,0XF0,0X9F,0X80,0X00,0X00,
0X12,0X18,0X00,0X00,0X00,0X00,0X1A,0X0C,0X00,0X7C,0X0F,0X80,0X1E,0X5D,0XFF,0XEF,
0XFF,0X00,0X0F,0X7C,0XFF,0XE7,0XF1,0X00,0X07,0X04,0XFF,0XE5,0XE1,0X00,0X03,0XFD,
0XFF,0XE7,0XC3,0X00,0X00,0XFC,0X3F,0XFF,0X83,0X80,0X00,0X3E,0X5F,0XE0,0X01,0X80,
0X00,0X1E,0X7F,0XE0,0X00,0X00,0X00,0X07,0X3F,0X80,0X00,0X00,0X00,0X03,0X3E,0X00,
0X00,0X00,0X00,0X02,0X00,0X00,0X00,0X00,0X00,0X03,0X00,0X00,0X00,0X00,0X00,0X03,
0X80,0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,

0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0X60,0X18,0X00,0X00,0X00,0X3E,
0X7C,0X30,0XC0,0X00,0X00,0X3E,0X6C,0X21,0XE0,0X00,0X00,0X7C,0XC7,0X3F,0XFF,0X00,
0X00,0XE8,0XFF,0XFF,0XE0,0X00,0X03,0XFC,0XE7,0XC1,0XC0,0X00,0X0F,0XFC,0XE3,0XC0,
0X40,0X00,0X1F,0XFC,0XE3,0X80,0X00,0X00,0X1F,0XFC,0XE7,0X80,0X00,0X00,0X1F,0XFC,
0XE7,0X00,0X00,0X00,0X3F,0XFC,0XE6,0X00,0X00,0X00,0X3F,0XFE,0XC6,0X04,0X00,0X80,
0X3F,0XF9,0X04,0X1E,0X03,0X80,0X3F,0XF1,0XE4,0XFD,0XFF,0X00,0X3F,0XE7,0XFF,0XF9,
0XFF,0X00,0X3F,0XCE,0X7F,0X88,0XFE,0X00,0X3F,0X9C,0X63,0X88,0XFE,0X80,0X3F,0X98,
0X63,0XD8,0XFF,0XE0,0X3F,0X3B,0X7A,0X1F,0XFE,0X80,0X3F,0X3F,0XFD,0X98,0X7E,0X80,
0X3F,0X21,0X31,0X98,0X7F,0X80,0X3F,0X20,0X30,0X1A,0X7F,0X80,0X3F,0X20,0XB1,0X98,
0XFF,0X80,0X3F,0X30,0XBC,0X2E,0XFE,0X00,0X3F,0X90,0XBD,0XCC,0XFC,0X00,0X3F,0X98,
0XF3,0XF8,0X00,0X00,0X3F,0XC0,0XFB,0XF0,0X00,0X00,0X1F,0XF0,0X9F,0X80,0X00,0X00,
0X1F,0XF8,0X00,0X00,0X00,0X00,0X0F,0XFC,0X00,0X7C,0X0F,0X80,0X1F,0XFD,0XFF,0XEF,
0XFC,0X00,0X0F,0XFC,0XFF,0XE7,0XF0,0X00,0X07,0XFC,0XFF,0XE5,0XE0,0X00,0X03,0XFD,
0XFF,0XE7,0XC0,0X00,0X00,0XFC,0X3F,0XFF,0X80,0X00,0X00,0X3E,0X5F,0XE0,0X00,0X00,
0X00,0X1E,0X7F,0XE0,0X00,0X00,0X00,0X07,0X3F,0X80,0X00,0X00,0X00,0X03,0X3E,0X00,
0X00,0X00,0X00,0X02,0X00,0X00,0X00,0X00,0X00,0X03,0X00,0X00,0X00,0X00,0X00,0X03,
0X80,0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00
};
const unsigned char ris_2[]PROGMEM = {//корабль влево
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00,0X00,0X00,0X03,0X80,0X00,
0X00,0X00,0X00,0X03,0X00,0X00,0X00,0X00,0X00,0X02,0X00,0X00,0X00,0X00,0X00,0X03,
0X3E,0X00,0X00,0X00,0X00,0X07,0X3F,0X80,0X00,0X00,0X00,0X1E,0X7F,0XE0,0X00,0X00,
0X00,0X3E,0X5F,0XE0,0X01,0X80,0X00,0XFC,0X3F,0XFF,0X83,0X80,0X03,0XFD,0XFF,0XE7,
0XC3,0X00,0X07,0X04,0XFF,0XE5,0XE1,0X00,0X0F,0X7C,0XFF,0XE7,0XF1,0X00,0X1E,0X5D,
0XFF,0XEF,0XFF,0X00,0X1A,0X0C,0X00,0X7C,0X0F,0X80,0X12,0X18,0X00,0X00,0X00,0X00,
0X16,0XF0,0X9F,0X80,0X00,0X00,0X24,0X40,0XFB,0XF0,0X00,0X00,0X24,0X98,0XF3,0XF8,
0X00,0X00,0X24,0XD0,0XBD,0XCC,0XFC,0X1C,0X24,0XB0,0XBC,0X2E,0XFE,0X1C,0X24,0XA0,
0XB1,0X98,0XFF,0X9C,0X24,0XA0,0X30,0X1A,0X7F,0X9C,0X24,0XA1,0X31,0X98,0X7F,0X9E,
0X2C,0XBF,0XFD,0X98,0X7E,0X9E,0X2C,0XBB,0X7A,0X1F,0XFE,0X9E,0X2C,0X98,0X63,0XD8,
0XFF,0XFE,0X2C,0X9C,0X63,0X88,0XFE,0X9E,0X2C,0XCE,0X7F,0X88,0XFE,0X00,0X2C,0XE7,
0XFF,0XF9,0XFF,0X00,0X24,0XB1,0XE4,0XFD,0XFF,0X00,0X24,0X99,0X04,0X1E,0X03,0X80,
0X24,0X96,0XC6,0X04,0X00,0X80,0X34,0X96,0XE6,0X00,0X00,0X00,0X3C,0X9E,0XE7,0X00,
0X00,0X00,0X1C,0X16,0XE7,0X80,0X06,0X00,0X1E,0X12,0XE3,0X80,0X06,0X00,0X0F,0X9E,
0XE3,0XC0,0X46,0X00,0X03,0X96,0XE7,0XC1,0XC6,0X00,0X00,0XE8,0XFF,0XFF,0XE6,0X00,
0X00,0X7C,0XC7,0X3F,0XFF,0X00,0X00,0X3E,0X6C,0X21,0XE0,0X00,0X00,0X3E,0X7C,0X30,
0XC0,0X00,0X00,0X03,0X60,0X18,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,

0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00,0X00,0X00,0X03,0X80,0X00,
0X00,0X00,0X00,0X03,0X00,0X00,0X00,0X00,0X00,0X02,0X00,0X00,0X00,0X00,0X00,0X03,
0X3E,0X00,0X00,0X00,0X00,0X07,0X3F,0X80,0X00,0X00,0X00,0X1E,0X7F,0XE0,0X00,0X00,
0X00,0X3E,0X5F,0XE0,0X00,0X00,0X00,0XFC,0X3F,0XFF,0X80,0X00,0X03,0XFD,0XFF,0XE7,
0XC0,0X00,0X07,0XFC,0XFF,0XE5,0XE0,0X00,0X0F,0XFC,0XFF,0XE7,0XF0,0X00,0X1F,0XFD,
0XFF,0XEF,0XFC,0X00,0X0F,0XFC,0X00,0X7C,0X0F,0X80,0X1F,0XF8,0X00,0X00,0X00,0X00,
0X1F,0XF0,0X9F,0X80,0X00,0X00,0X3F,0XC0,0XFB,0XF0,0X00,0X00,0X3F,0X98,0XF3,0XF8,
0X00,0X00,0X3F,0X90,0XBD,0XCC,0XFC,0X00,0X3F,0X30,0XBC,0X2E,0XFE,0X00,0X3F,0X20,
0XB1,0X98,0XFF,0X80,0X3F,0X20,0X30,0X1A,0X7F,0X80,0X3F,0X21,0X31,0X98,0X7F,0X80,
0X3F,0X3F,0XFD,0X98,0X7E,0X80,0X3F,0X3B,0X7A,0X1F,0XFE,0X80,0X3F,0X98,0X63,0XD8,
0XFF,0XE0,0X3F,0X9C,0X63,0X88,0XFE,0X80,0X3F,0XCE,0X7F,0X88,0XFE,0X00,0X3F,0XE7,
0XFF,0XF9,0XFF,0X00,0X3F,0XF1,0XE4,0XFD,0XFF,0X00,0X3F,0XF9,0X04,0X1E,0X03,0X80,
0X3F,0XFE,0XC6,0X04,0X00,0X80,0X3F,0XFC,0XE6,0X00,0X00,0X00,0X1F,0XFC,0XE7,0X00,
0X00,0X00,0X1F,0XFC,0XE7,0X80,0X00,0X00,0X1F,0XFC,0XE3,0X80,0X00,0X00,0X0F,0XFC,
0XE3,0XC0,0X40,0X00,0X03,0XFC,0XE7,0XC1,0XC0,0X00,0X00,0XE8,0XFF,0XFF,0XE0,0X00,
0X00,0X7C,0XC7,0X3F,0XFF,0X00,0X00,0X3E,0X6C,0X21,0XE0,0X00,0X00,0X3E,0X7C,0X30,
0XC0,0X00,0X00,0X03,0X60,0X18,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00
};
const unsigned char ris_3[]PROGMEM = {// ядро пушки
0X00,0X18,0X0A,0X7E,0X14,0XE7,0X02,0XD3,0X02,0XFF,0X14,0XFF,0X0A,0X7E,0X00,0X18,

0X00,0X18,0X00,0X7E,0X00,0XFF,0X00,0XFF,0X00,0XFF,0X00,0XFF,0X00,0X7E,0X00,0X18
};
const unsigned char ris_4[]PROGMEM = {//обломкм корабля
 0X00,0X00,0X00,0X00,0X20,0X00,0X01,0X81,0X08,0XFC,0X38,0X00,0X1F,0X83,0XFF,0XFF,
0XF8,0X00,0X3F,0X83,0XFC,0X1F,0XE0,0X00,0X3F,0X0F,0XFE,0X7C,0X00,0X30,0X38,0X09,
0XFE,0X60,0X00,0X70,0X38,0XE3,0XFF,0X60,0X00,0X70,0X79,0XC7,0XFF,0X80,0X10,0X3C,
0X73,0XCF,0XF0,0X00,0X7F,0X3C,0X33,0XE7,0XC0,0X01,0XFF,0X30,0X07,0X27,0X07,0XF9,
0XFF,0X80,0X0C,0X74,0X1F,0XDD,0XFE,0X00,0X19,0XF0,0X37,0X88,0X78,0X30,0X1D,0X11,
0X61,0X1A,0X60,0XF8,0X38,0X31,0XFC,0X9C,0X03,0XF8,0X3C,0X20,0XBD,0X8C,0X07,0XE0,
0X34,0XC8,0XB0,0XC8,0X0F,0X80,0X36,0X58,0XD8,0XE0,0X0E,0X00,0X14,0X88,0X5F,0X00,
0X1C,0X00,0X0A,0X58,0X1C,0X0F,0XFF,0XF0,0X0B,0X58,0X70,0X7F,0XFF,0XF0,0X13,0X69,
0XC3,0XFF,0XFF,0XF0,0X12,0X66,0X1F,0XFF,0XF8,0X00,0X36,0X4C,0X1F,0XFF,0XE0,0X00,
0X2C,0X4D,0X0F,0XE7,0XFF,0XE0,0X24,0XCC,0X87,0XF0,0X3F,0XF0,0X44,0XCC,0X78,0XFE,
0X07,0XF0,0X49,0XE6,0X60,0X3F,0XF8,0X30,0X69,0X26,0X63,0X07,0XFC,0X00,0X73,0X33,
0XF3,0XD0,0X7F,0X80,0X72,0X42,0XFF,0X1E,0X0F,0XFC,0X70,0X58,0X0F,0X19,0X83,0XFE,
0X30,0X7B,0X13,0X91,0XC0,0XFE,0X1C,0X93,0X91,0XE1,0XFC,0X0E,0X0C,0X93,0X18,0X77,
0XFF,0X00,0X0C,0XF7,0X30,0X77,0XFB,0XE0,0X06,0X67,0X38,0X3B,0XF8,0X78,0X67,0X8E,
0X1C,0X00,0X7C,0X78,0X77,0X8E,0X38,0X00,0X18,0X18,0X77,0XCB,0X7C,0X00,0X1C,0X00,
0X78,0XC8,0XF8,0X00,0X0C,0X00,0X38,0XDD,0XF8,0X00,0X00,0X00,0X3C,0X1F,0X87,0X08,
0XE0,0X00,0X3F,0X01,0X0F,0XF8,0XE0,0X00,0X1F,0XC0,0X08,0XF8,0XC0,0X00,0X0F,0XE0,
0X0C,0X79,0XC0,0X00,0X00,0XC0,0X04,0X3F,0X80,0X00,0X00,0X00,0X00,0X00,0X80,0X00,

 0X00,0X00,0X00,0X00,0X20,0X00,0X00,0X01,0X08,0XFC,0X38,0X00,0X00,0X03,0XFF,0XFF,
0XF8,0X00,0X00,0X03,0XFC,0X1F,0XE0,0X00,0X00,0X0F,0XFE,0X7C,0X00,0X30,0X00,0X09,
0XFE,0X60,0X00,0X70,0X00,0XE3,0XFF,0X60,0X00,0X70,0X01,0XC7,0XFF,0X80,0X10,0X3C,
0X03,0XCF,0XF0,0X00,0X7F,0X3C,0X03,0XE7,0XC0,0X01,0XFF,0X30,0X07,0XE7,0X07,0XF9,
0XFF,0X80,0X0F,0XF4,0X1F,0XDD,0XFE,0X00,0X1F,0XF0,0X3F,0X88,0X78,0X00,0X1F,0XF1,
0X7F,0X1A,0X60,0X00,0X3F,0XF1,0XFF,0X9C,0X00,0X00,0X3F,0XE0,0XBF,0X8C,0X00,0X00,
0X37,0XE8,0XBF,0XC8,0X00,0X00,0X37,0XD8,0XDF,0XE0,0X00,0X00,0X17,0X88,0X5F,0X00,
0X00,0X00,0X0B,0XD8,0X1C,0X00,0X00,0X00,0X0B,0XD8,0X70,0X00,0X00,0X00,0X13,0XF9,
0XC0,0X00,0X00,0X00,0X13,0XFE,0X00,0X00,0X00,0X00,0X37,0XFC,0X00,0X00,0X00,0X00,
0X2F,0XFD,0X00,0X00,0X00,0X00,0X27,0XFC,0X80,0X00,0X00,0X00,0X47,0XFC,0X78,0X00,
0X00,0X00,0X4F,0XFE,0X60,0X00,0X00,0X00,0X6F,0XFE,0X63,0X00,0X00,0X00,0X7F,0XFF,
0XF3,0XD0,0X00,0X00,0X7F,0XFF,0XFF,0X1E,0X00,0X00,0X7F,0XFF,0XFF,0X1F,0X80,0X00,
0X3F,0XFF,0XF3,0X9F,0XC0,0X00,0X1F,0X9F,0XF1,0XFF,0XFC,0X00,0X0F,0X9F,0XF8,0X7F,
0XFF,0X00,0X0F,0XFF,0XF0,0X7F,0XFB,0XE0,0X07,0XFF,0XF8,0X3B,0XF8,0X78,0X07,0XFF,
0XFC,0X00,0X7C,0X78,0X07,0XFF,0XF8,0X00,0X18,0X18,0X07,0XFB,0XFC,0X00,0X1C,0X00,
0X00,0XF8,0XF8,0X00,0X0C,0X00,0X00,0XFD,0XF8,0X00,0X00,0X00,0X00,0X1F,0X87,0X08,
0XE0,0X00,0X00,0X01,0X0F,0XF8,0XE0,0X00,0X00,0X00,0X08,0XF8,0XC0,0X00,0X00,0X00,
0X0C,0X79,0XC0,0X00,0X00,0X00,0X04,0X3F,0X80,0X00,0X00,0X00,0X00,0X00,0X80,0X00
};

lilik
Offline
Зарегистрирован: 19.10.2017

// игра канонир
#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>
#define TFT_CS     10
#define TFT_RST    9  
#define TFT_DC     8
 Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS,  TFT_DC, TFT_RST);
 
extern const unsigned char ris_0[];
extern const unsigned char ris_1[];
extern const unsigned char ris_2[];
extern const unsigned char ris_3[];
extern const unsigned char ris_4[];
long Yk=0;//переменная хранения моментов времени
long Yj=0;//переменная хранения моментов времени
int i=0;// счётчик-переменная хранения положения корабля
int k=1;//
byte tt=1;//переменная задающая скорость движения корабля
int X=20;//счётчик-переменная хранения положения ядра
byte Nk=0;//счётчик утопленных кораблей
byte Nj=0;//счётчик расхода ядер

void setup(void) {
  digitalWrite(2, HIGH);// включить подтягивающий резистор для кнопки 
  // Используйте этот инициализатор, если вы используете 1,8-дюймовый TFT
 tft.initR(INITR_BLACKTAB);   // initialize a ST7735S chip, black tab
 //
 while(digitalRead(2)==HIGH){
 drawBitmap_(0,0,ris_0,128,160,1);//заставка
 delay(300);
 drawBitmap_(0,0,ris_0,128,160,2);//заставка
 delay(300);
 }
 //
 tft.fillScreen(tft.Color565(0,55,255));// фон моря
 tft.fillRect(80,0,48,160,tft.Color565(0,255,255));//фон неба
 tft.fillRect(0,65,5,30,tft.Color565(0,0,0));tft.fillRect(0,75,20,10,tft.Color565(0,0,0));//пушка
for(int j=0;j<9;j++){drawBitmap_(5,8*j,ris_3,16,8,2);}//обойма ядер рисуется
//
 tft.setRotation(0);//ориентация экрана
delay(200); 
 }
void loop() {
  //
 if(millis()-Yk>7*tt){//гоняем кораблик - мишень вдоль горизонта 
 Yk=millis();i=i+k;if(k==1){drawBitmap_(80,i,ris_1,48,48,1);}if(k==-1){drawBitmap_(80,i,ris_2,48,48,1);}
 if(i==112){k=-1;tft.fillRect(X,75,16,8,tft.Color565(0,55,255));X=20;delay(500*tt);tt=random(2,8);}
 if(i==0){k=1;tft.fillRect(X,75,16,8,tft.Color565(0,55,255));X=20;delay(500*tt);tt=random(2,8);}
 }
 if(millis()-Yj>5&&X>=21&&X<=60){Yj=millis();drawBitmap_(X,75,ris_3,16,8,2);X=X+2;}//рисуем полёт ядра если был выстрел
 
 if(digitalRead(2)==LOW){//производим выстрел по нажатию кнопки
  Nj++;if(Nj>9){Nj=0;for(int j=0;j<9;j++){drawBitmap_(5,8*j,ris_3,16,8,2);}}tft.fillRect(5,8*Nj-8,16,8,tft.Color565(0,55,255));//расход обоймы ядер рисуем
  tft.fillRect(X,75,16,8,tft.Color565(0,55,255));X=21;delay(150);
  }
 
 if(X>60){//если ядро попало то рисуем обломки корабля, а если  долетело стираем его изображение
  tft.fillRect(X,75,16,8,tft.Color565(0,55,255));
  if(i>50&&i<60){drawBitmap_(80,i,ris_4,48,48,1);delay(1000);Nk++;if(Nk>4){Nk=0;tft.fillRect(8*Nk-8,105,80,48,tft.Color565(0,55,255));}drawBitmap_(8*Nk-8,105,ris_1,48,48,2);}X=20;//условие попадания в цель
  }
 //
}
/////////////////////////////////////////////////////////////////////
void drawBitmap_(int x,int y, const uint8_t *bitmap,int w,int h,byte pal) {//функция вывода 4-х цветного рисунка по координатам, заданного размера и выбранной палитры
if(x<0||x+w>128||y<0||y+h>160){return;} 
 tft.setAddrWindow(x,y,x+w-1,y+h-1);
 int i, j, byteWidth = (w + 7) / 8;
  uint8_t byte_r;uint8_t byte_g;uint8_t byte_b;
   //
  SPI.beginTransaction(SPISettings(8000000, MSBFIRST, SPI_MODE0));
  digitalWrite(TFT_DC, HIGH);
  digitalWrite(TFT_CS, LOW); 
 for(j=0; j<h; j++) {
    for(i=0; i<w; i++) {
      if(i & 7) {byte_r <<= 1;byte_g <<= 1;}
      else     { byte_r = pgm_read_byte(bitmap + j * byteWidth + i / 8);byte_g = pgm_read_byte(bitmap + (j+h) * byteWidth + i / 8);}
      if((byte_r&0x80)&&(byte_g&0x80))
      {if(pal==1){SPI.transfer(tft.Color565(50,50,50)>>8);SPI.transfer(tft.Color565(50,50,50));}if(pal==2){SPI.transfer(tft.Color565(0,0,0)>>8);SPI.transfer(tft.Color565(0,0,0));}}
      if(!(byte_r&0x80)&&!(byte_g&0x80))
      {if(pal==1){SPI.transfer(tft.Color565(0,255,255)>>8);SPI.transfer(tft.Color565(0,255,255));}if(pal==2){SPI.transfer(tft.Color565(0,55,255)>>8);SPI.transfer(tft.Color565(0,55,255));}}
      if((byte_r&0x80)&&!(byte_g&0x80))
      {if(pal==1){SPI.transfer(tft.Color565(255,0,0)>>8);SPI.transfer(tft.Color565(255,0,0));}if(pal==2){SPI.transfer(tft.Color565(255,100,0)>>8);SPI.transfer(tft.Color565(255,100,0));}}
      if(!(byte_r&0x80)&&(byte_g&0x80))
      {if(pal==1){SPI.transfer(tft.Color565(250,250,0)>>8);SPI.transfer(tft.Color565(250,250,0));}if(pal==2){SPI.transfer(tft.Color565(250,250,250)>>8);SPI.transfer(tft.Color565(250,250,250));}}
      
    }
  }
  digitalWrite(TFT_CS, HIGH);
  SPI.endTransaction();
 ///  
}
/////////////////////////////////////////////////////////////////////
#include <avr/pgmspace.h>
const unsigned char ris_0[]PROGMEM = {//заставка
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X0F,0XC0,0X00,0X00,0X00,0X00,0X1E,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X1C,0X60,0X00,0X00,0X00,0X00,0X31,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X10,0X30,0X00,0X00,0X00,0X00,0X1C,0X60,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X30,0X10,0X00,0X00,0X00,0X00,0XBF,0X30,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X30,0X18,0X00,0X00,0X00,0X00,0XFF,0X90,0X00,0X00,0X00,0X7F,0XFC,0X00,0X00,
0X00,0X30,0X08,0X00,0X00,0X00,0X01,0X3F,0X90,0X00,0X00,0X00,0X7F,0XFE,0X00,0X00,
0X00,0X30,0X08,0X00,0X00,0X00,0X01,0X9F,0X90,0X00,0X00,0X00,0X7F,0XFE,0X00,0X00,
0X00,0X30,0X18,0X00,0X00,0X00,0X01,0X80,0X10,0X00,0X00,0X00,0X01,0X80,0X00,0X00,
0X00,0X10,0X1C,0X00,0X00,0X00,0X01,0X80,0X30,0X01,0X82,0X00,0X01,0X80,0X00,0X00,
0X00,0X18,0X14,0X00,0X00,0X00,0X01,0X80,0X30,0X01,0XCE,0X00,0X03,0XC0,0X00,0X00,
0X00,0X0C,0X24,0X00,0X00,0X00,0X01,0X80,0X30,0X00,0XF8,0X00,0X0F,0XF0,0X00,0X00,
0X00,0X07,0XC6,0X00,0X00,0X00,0X01,0X80,0X30,0X00,0X30,0X00,0X7E,0X7C,0X00,0X00,
0X00,0X0C,0X66,0X00,0X00,0X00,0X01,0X80,0X30,0X01,0XFE,0X00,0X7C,0X3E,0X00,0X00,
0X00,0X08,0X1C,0X00,0X00,0X00,0X01,0X80,0X30,0X01,0XFE,0X00,0X70,0X0E,0X00,0X00,
0X00,0X10,0X08,0X00,0X00,0X00,0X00,0X80,0X30,0X00,0X30,0X00,0X40,0X00,0X00,0X00,
0X00,0X10,0X08,0X00,0X00,0X00,0X03,0X40,0X30,0X00,0XF8,0X00,0X40,0X00,0X00,0X00,
0X00,0X30,0X0C,0X00,0X00,0X00,0X03,0X20,0X30,0X01,0XCE,0X00,0X78,0X00,0X00,0X00,
0X00,0X10,0X0C,0X00,0X00,0X00,0X03,0X1F,0XB0,0X01,0X00,0X00,0X7F,0X00,0X00,0X00,
0X00,0X10,0X0C,0X00,0X00,0X00,0X03,0X00,0X30,0X00,0X00,0X00,0X1F,0XE0,0X00,0X00,
0X00,0X18,0X08,0X00,0X00,0X00,0X03,0X00,0X30,0X01,0XFE,0X00,0X0D,0XFC,0X00,0X00,
0X00,0X0C,0X18,0X00,0X00,0X00,0X02,0X00,0X30,0X00,0X0E,0X00,0X0C,0X7E,0X00,0X00,
0X00,0X07,0X70,0X00,0X00,0X00,0X02,0X00,0X30,0X00,0X3C,0X00,0X0C,0X1E,0X00,0X00,
0X00,0X01,0XC0,0X00,0X40,0X00,0X02,0X00,0X20,0X01,0XE0,0X00,0X0C,0XFE,0X00,0X00,
0X00,0X00,0X00,0X1F,0XFF,0X00,0X02,0X00,0X20,0X01,0XC0,0X00,0X0F,0XFC,0X00,0X00,
0X00,0X00,0X00,0XF8,0X01,0XE0,0X02,0X00,0X20,0X00,0XF0,0X00,0X3F,0XE0,0X00,0X00,
0X00,0X00,0X01,0XC0,0X00,0X38,0X06,0X00,0X20,0X00,0X1C,0X00,0X7F,0X00,0X00,0X00,
0X00,0X00,0X07,0X00,0X00,0X0E,0X06,0X00,0X20,0X01,0XFE,0X00,0X78,0X00,0X00,0X00,
0X00,0X00,0X0C,0X00,0X00,0X03,0X06,0X00,0X20,0X01,0XFC,0X00,0X40,0X00,0X00,0X00,
0X00,0X00,0X18,0X00,0X3C,0X00,0XC6,0X00,0X20,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X30,0X03,0XFF,0XC0,0X66,0X00,0X20,0X01,0XFE,0X00,0X7F,0XFC,0X00,0X00,
0X00,0X00,0X60,0X1D,0X20,0X70,0X36,0X00,0X20,0X01,0XFE,0X00,0X7F,0XFE,0X00,0X00,
0X00,0X00,0XC0,0X31,0X20,0X0C,0X14,0X00,0X20,0X00,0XC0,0X00,0X7F,0XFE,0X00,0X00,
0X00,0X08,0X80,0XC1,0X20,0X06,0X0C,0X00,0X20,0X00,0X30,0X00,0X01,0X80,0X00,0X00,
0X00,0X0D,0X81,0X81,0X30,0X01,0X84,0X00,0X60,0X00,0X1C,0X00,0X01,0X80,0X00,0X00,
0X00,0X09,0X02,0X01,0X30,0X03,0X84,0X00,0X60,0X01,0XFE,0X00,0X01,0X80,0X00,0X00,
0X00,0X0B,0X04,0X01,0X30,0X06,0X44,0X00,0X60,0X01,0XFC,0X00,0X01,0X80,0X00,0X00,
0X00,0X12,0X0C,0X01,0X90,0X0C,0X64,0X00,0X60,0X00,0X00,0X00,0X01,0X80,0X00,0X00,
0X00,0X36,0X1C,0X01,0X90,0X08,0XD4,0X00,0X60,0X00,0X00,0X00,0X7F,0XFC,0X00,0X00,
0X00,0X26,0X33,0X01,0X90,0X10,0X8C,0X00,0X60,0X00,0X00,0X00,0X7F,0XFE,0X00,0X00,
0X00,0X1C,0X21,0X80,0X90,0X31,0X0C,0X00,0X60,0X00,0X00,0X00,0X7F,0XFE,0X00,0X00,
0X00,0X1C,0X70,0XC0,0X92,0X62,0X0C,0X00,0X40,0X01,0XFE,0X00,0X00,0X00,0X00,0X00,
0X00,0X0C,0X4C,0X6F,0XFF,0XE6,0X04,0X00,0X40,0X01,0XB0,0X00,0X00,0X00,0X00,0X00,
0X00,0X0C,0X46,0X70,0X00,0X3C,0X0C,0X00,0X40,0X00,0X30,0X00,0X07,0X80,0X00,0X00,
0X00,0X0C,0XC3,0X80,0X00,0X03,0X8C,0X00,0X40,0X01,0XFC,0X00,0X1F,0XF0,0X00,0X00,
0X00,0X08,0X86,0X00,0X00,0X00,0XEC,0X00,0X40,0X01,0XCE,0X00,0X3F,0XF8,0X00,0X00,
0X00,0X18,0X8C,0X00,0X00,0X00,0X3C,0X00,0X40,0X01,0X00,0X00,0X78,0X3C,0X00,0X00,
0X00,0X1C,0X98,0X00,0X00,0X00,0X0C,0X00,0XC0,0X01,0X84,0X00,0X70,0X0C,0X00,0X00,
0X00,0X3C,0XA0,0X00,0X00,0X00,0X06,0X00,0XC0,0X01,0XFE,0X00,0X60,0X0C,0X00,0X00,
0X00,0X38,0XC0,0X03,0XFF,0XE0,0X01,0X80,0XC0,0X00,0X30,0X00,0X60,0X0E,0X00,0X00,
0X00,0X10,0X80,0X0F,0X65,0XF8,0X00,0XC0,0XC0,0X00,0X30,0X00,0X60,0X0E,0X00,0X00,
0X00,0X21,0X00,0X73,0XC4,0X0F,0X00,0X40,0XC0,0X00,0X30,0X00,0X60,0X0C,0X00,0X00,
0X00,0X73,0X00,0XC6,0XE5,0XF9,0XC0,0X20,0XC0,0X01,0XFE,0X00,0X78,0X1C,0X00,0X00,
0X00,0XF2,0X03,0X0C,0XE5,0X08,0X60,0X30,0XC0,0X01,0X8E,0X00,0X3F,0XFC,0X00,0X00,
0X00,0X34,0X07,0X19,0X66,0X10,0X38,0X18,0XC0,0X00,0X00,0X00,0X1F,0XF8,0X00,0X00,
0X00,0X30,0X1C,0XB2,0X65,0X10,0X1C,0X0C,0XC0,0X00,0XF8,0X00,0X0F,0XE0,0X00,0X00,
0X00,0X18,0X38,0XE4,0X65,0X30,0X1E,0X04,0X80,0X01,0XFC,0X00,0X00,0X00,0X00,0X00,
0X00,0X78,0X68,0X4C,0X64,0XB0,0X37,0X06,0X80,0X01,0X06,0X00,0X00,0X00,0X00,0X00,
0X00,0X38,0X54,0X68,0X64,0X60,0X61,0X02,0X80,0X01,0X06,0X00,0X7F,0XFC,0X00,0X00,
0X00,0X2F,0X9C,0X30,0XE6,0X60,0XC1,0X81,0X80,0X01,0X86,0X00,0X7F,0XFE,0X00,0X00,
0X00,0X41,0X0E,0X30,0XA6,0X60,0X83,0X81,0X80,0X01,0XFC,0X00,0X7F,0XFE,0X00,0X00,
0X00,0X7D,0X87,0X10,0XA5,0X41,0X07,0X61,0X80,0X00,0XF8,0X00,0X01,0X80,0X00,0X00,
0X00,0X73,0XC3,0X18,0XA4,0XC3,0X0F,0X20,0XE0,0X00,0X00,0X00,0X01,0X80,0X00,0X00,
0X00,0X62,0X60,0X88,0XA4,0XC6,0X1B,0X30,0XB0,0X01,0XFE,0X00,0X01,0X80,0X00,0X00,
0X00,0X66,0X30,0X4F,0XE6,0X8C,0X33,0X10,0XD0,0X01,0XFE,0X00,0X01,0X80,0X00,0X00,
0X00,0X44,0X1C,0X64,0X34,0X88,0X63,0X10,0X48,0X00,0X06,0X00,0X01,0X80,0X00,0X00,
0X00,0XC4,0X0E,0X26,0X04,0X98,0XC3,0X08,0X64,0X00,0X06,0X00,0X7F,0XFE,0X00,0X00,
0X00,0X68,0X03,0XB2,0X36,0XB1,0X83,0X08,0X62,0X01,0XE6,0X00,0X7F,0XFE,0X00,0X00,
0X00,0XC8,0X00,0XF3,0XF7,0X23,0X03,0X0C,0X52,0X01,0XFE,0X00,0X7F,0XFC,0X00,0X00,
0X00,0XC8,0X00,0X19,0X11,0X46,0X03,0X0C,0X52,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X38,0X00,0X0C,0X93,0X8C,0X02,0X0C,0X62,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X00,0X04,0XFF,0X1C,0X02,0X0C,0X66,0X01,0XFE,0X00,0X00,0X00,0X00,0X00,
0X00,0X78,0X00,0X02,0XFF,0X34,0X02,0X04,0X46,0X01,0XB0,0X00,0X7F,0XFE,0X00,0X00,
0X00,0X30,0X00,0X03,0XFF,0X24,0X02,0X04,0X46,0X00,0X30,0X00,0X7F,0XFE,0X00,0X00,
0X00,0XF0,0X00,0X03,0XFF,0XC4,0X02,0X04,0X66,0X01,0XFC,0X00,0X7C,0X0C,0X00,0X00,
0X00,0XDF,0XFF,0XFF,0XFF,0XCF,0XFF,0XFC,0X7F,0X01,0XCE,0X00,0X1E,0X00,0X00,0X00,
0X00,0X50,0X0C,0XFF,0XFF,0XFF,0XF0,0X4C,0X21,0X00,0X00,0X00,0X0F,0X00,0X00,0X00,
0X00,0XD0,0X00,0X03,0XFF,0XE0,0X00,0X0C,0X61,0X80,0X06,0X00,0X03,0XC0,0X00,0X00,
0X00,0X88,0X00,0X03,0XF3,0XF0,0X00,0X0C,0X60,0X80,0X1C,0X00,0X00,0XF0,0X00,0X00,
0X00,0XCF,0XFF,0XFF,0XF3,0XFF,0XFF,0XCC,0X40,0XC1,0XF0,0X00,0X00,0X78,0X00,0X00,
0X00,0X9F,0X80,0X03,0XFF,0XE8,0X0D,0XFC,0X40,0XC1,0XE0,0X00,0X7F,0XFC,0X00,0X00,
0X00,0X88,0X00,0X03,0XFF,0XE0,0X08,0X08,0X40,0X60,0X7C,0X00,0X7F,0XFE,0X00,0X00,
0X00,0X8C,0X00,0X03,0XFB,0XF0,0X08,0X08,0X40,0X20,0X0E,0X00,0X7F,0XFC,0X00,0X00,
0X00,0XC4,0X00,0X06,0XFF,0X98,0X10,0X08,0X40,0X30,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XC4,0X00,0X04,0XFF,0XCC,0X20,0X18,0X60,0X10,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XC4,0X00,0X09,0XBD,0X66,0X60,0X10,0XE0,0X18,0X00,0X00,0X60,0X00,0X00,0X00,
0X00,0XC6,0X00,0X1B,0X0D,0X31,0XA0,0X10,0XB0,0X08,0X00,0X00,0X7F,0XFC,0X00,0X00,
0X00,0XC2,0X00,0X32,0X09,0X18,0XE0,0X30,0X90,0X0C,0X00,0X00,0X7F,0XFE,0X00,0X00,
0X00,0XC3,0X00,0X26,0X09,0X8C,0X60,0X31,0X98,0X0E,0X00,0X00,0X63,0X0C,0X00,0X00,
0X00,0X41,0X00,0X6C,0X09,0X86,0X38,0X21,0X08,0X07,0X00,0X00,0X03,0X0E,0X00,0X00,
0X00,0X41,0X80,0XC8,0X0C,0X87,0X1C,0X63,0X0C,0X01,0X00,0X00,0X03,0X0C,0X00,0X00,
0X00,0X60,0X81,0X98,0X0C,0X89,0X86,0X43,0X0C,0X01,0X80,0X00,0X03,0X0C,0X00,0X00,
0X00,0X20,0XC1,0X30,0X0C,0X98,0XC3,0X83,0X06,0X00,0XC0,0X00,0X03,0XFC,0X00,0X00,
0X00,0X30,0X62,0X20,0X0C,0XD0,0X61,0X85,0X06,0X00,0X40,0X00,0X01,0XF8,0X00,0X00,
0X00,0X10,0X36,0X60,0X0C,0XE0,0X33,0X0D,0X03,0X00,0X60,0X00,0X00,0XF0,0X00,0X00,
0X00,0X18,0X1C,0X40,0X04,0XFF,0XF3,0X0A,0X01,0X80,0X30,0X00,0X00,0X00,0X00,0X00,
0X00,0X08,0X0C,0XC0,0X04,0X40,0X2E,0X12,0X00,0XC0,0X18,0X00,0X00,0X00,0X00,0X00,
0X00,0X04,0X07,0X80,0X04,0X40,0X0C,0X16,0X00,0XC0,0X18,0X00,0X00,0X00,0X00,0X00,
0X00,0X06,0X03,0X00,0X04,0X40,0X18,0XF2,0X00,0X60,0X0C,0X00,0X00,0X00,0X00,0X00,
0X00,0X03,0X01,0X80,0X06,0X40,0X31,0XFF,0XA0,0X30,0X06,0X00,0X00,0X00,0X00,0X00,
0X00,0X01,0X80,0X60,0X06,0X60,0XC3,0X07,0XFC,0X18,0X03,0X00,0X00,0X00,0X00,0X00,
0X00,0X70,0XC0,0X3C,0X06,0X67,0X86,0X07,0XC7,0XFC,0X03,0X80,0X00,0X00,0X00,0X00,
0X00,0X5C,0X60,0X07,0X87,0XFC,0X04,0X07,0XC0,0X03,0X01,0X80,0X00,0X00,0X00,0X00,
0X00,0X5F,0X90,0X00,0XFF,0X80,0X08,0X07,0XC0,0X81,0X80,0X80,0X07,0X03,0X80,0X00,
0X00,0XBF,0X78,0X00,0X00,0X00,0X38,0X07,0XC0,0X40,0X01,0X81,0XFF,0XCF,0X80,0X00,
0X00,0XBE,0X0E,0X00,0X00,0X00,0XFC,0X03,0XC0,0X00,0X06,0X83,0X18,0X6F,0X80,0X00,
0X00,0X7F,0X03,0X80,0X00,0X03,0XE6,0X03,0XC0,0X00,0X04,0X8C,0X06,0X3F,0X00,0X00,
0X00,0X7E,0X39,0XE0,0X00,0X7E,0XC2,0X03,0XC0,0X00,0X06,0X90,0XA5,0XFF,0X80,0X00,
0X00,0X3E,0XC6,0X6F,0XFF,0XF1,0X92,0X03,0XC0,0X00,0X03,0XF0,0XA4,0X9F,0XE0,0X00,
0X00,0X7E,0X19,0X10,0X7A,0X03,0X2D,0X03,0XC0,0X00,0X00,0XB0,0X50,0X7F,0XE0,0X00,
0X00,0X7E,0X07,0X4C,0X40,0X06,0X11,0X03,0XC0,0X00,0X01,0X38,0X50,0X0F,0XF0,0X00,
0X00,0X7E,0X00,0XB7,0X40,0X0C,0X21,0X83,0XC0,0X00,0X03,0X38,0X10,0X7F,0XF8,0X00,
0X00,0X7E,0X00,0X69,0XC0,0X18,0XC0,0X81,0XE0,0X00,0X02,0X2C,0X1C,0X4F,0XFC,0X00,
0X00,0XFF,0X00,0X36,0X60,0X31,0X80,0X81,0XE0,0X00,0X06,0X44,0X30,0X7F,0XFC,0X00,
0X00,0XFE,0X00,0X05,0X30,0X63,0X00,0X81,0XE0,0X00,0X03,0X46,0X00,0X3F,0XFE,0X00,
0X00,0XFC,0XE0,0X02,0XDC,0X52,0X00,0X81,0XE0,0X00,0X01,0XC2,0X00,0X07,0XFE,0X00,
0X00,0XBC,0X38,0X01,0XA6,0X84,0X00,0X81,0XF0,0X00,0X01,0XC1,0X00,0X07,0XFF,0X00,
0X00,0XBC,0X36,0X00,0X53,0XC8,0X00,0X81,0XFF,0XC0,0X03,0XE0,0X83,0X0F,0XFF,0X00,
0X00,0XFC,0X63,0X80,0X21,0XD0,0X00,0X9F,0XF4,0X7F,0XFF,0X7E,0X03,0XFF,0XFF,0X80,
0X00,0X7C,0X40,0XE0,0X19,0X60,0X00,0XF1,0XE0,0X63,0X18,0XE7,0X87,0XFF,0XFF,0X80,
0X00,0X78,0XC0,0X30,0X07,0X20,0X0E,0X81,0XF0,0X02,0X00,0X40,0XE7,0XFF,0XFF,0X80,
0X00,0X79,0X80,0X18,0X02,0X20,0X1C,0X81,0XE0,0X0F,0XC4,0X40,0X67,0XFF,0XFF,0X80,
0X00,0X39,0X00,0X16,0X06,0X60,0X71,0X01,0XEF,0XFF,0XFE,0XC0,0X73,0XFF,0XFF,0X80,
0X00,0X1A,0X00,0X23,0X04,0XC0,0XC3,0XFF,0XF3,0XC0,0X00,0XC0,0X7F,0XFF,0XFF,0X00,
0X00,0X04,0X00,0X61,0XC0,0X03,0X0E,0X7E,0X00,0X00,0X01,0X80,0X3F,0XF9,0XDC,0X00,
0X00,0X0C,0X00,0XC0,0X60,0X06,0X38,0X0C,0X08,0X23,0X81,0X80,0X01,0XE0,0X00,0X00,
0X00,0X08,0X00,0X80,0X30,0X18,0X70,0X30,0X08,0X3F,0XFF,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X01,0X00,0XFC,0X71,0XC0,0X60,0X08,0XF0,0X0E,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X03,0X03,0X8F,0XC3,0X00,0X80,0X09,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X06,0X0F,0X03,0X0E,0X01,0X00,0X0F,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X04,0X38,0X00,0X18,0X01,0X00,0X38,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X0C,0XE0,0X00,0X70,0X03,0XF0,0X60,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X0F,0X80,0X00,0X60,0X06,0X1C,0X40,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X1E,0X00,0X00,0XC0,0X06,0X06,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X38,0X00,0X0F,0X80,0X04,0X03,0X00,0X00,0X0C,0X00,0X00,0X00,0X00,0X00,
0X00,0X10,0XE0,0X00,0X3F,0XFF,0XE7,0X41,0X00,0X00,0X1F,0XFF,0X7E,0X00,0X00,0X00,
0X00,0X11,0XC0,0X00,0XFF,0XFF,0XF7,0XF9,0X00,0X00,0X0F,0XF3,0XFE,0X00,0X00,0X00,
0X00,0X3A,0X00,0X03,0X80,0X01,0XFF,0X34,0XFF,0XFF,0XF8,0X63,0X26,0X00,0X00,0X00,
0X00,0X7C,0X04,0X0E,0X00,0X00,0X0D,0X16,0X9E,0X03,0XF8,0XAA,0X13,0X00,0X00,0X00,
0X00,0X7E,0X04,0X38,0X00,0X00,0X0C,0X03,0X80,0X7F,0X8F,0XD6,0XC3,0X00,0X00,0X00,
0X00,0XFF,0X04,0XE0,0X00,0X00,0X07,0XB2,0X00,0X00,0X0F,0XFF,0XFF,0X00,0X00,0X00,
0X00,0XFF,0X07,0X80,0X00,0X00,0X02,0XFE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X7F,0X86,0X00,0X00,0X00,0X00,0X0C,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X7F,0XCE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X1F,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X0F,0XF0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X0F,0XF0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X07,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X03,0XFE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X03,0XFF,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X01,0XFF,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0XFF,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X18,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,

0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X0F,0XC0,0X00,0X00,0X00,0X00,0X1E,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X1C,0X60,0X00,0X00,0X00,0X00,0X31,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X10,0X30,0X00,0X00,0X00,0X00,0X00,0X60,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X30,0X10,0X00,0X00,0X00,0X00,0X80,0X30,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X30,0X18,0X00,0X00,0X00,0X00,0X80,0X10,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X30,0X08,0X00,0X00,0X00,0X01,0X00,0X10,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X30,0X08,0X00,0X00,0X00,0X01,0X80,0X10,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X30,0X18,0X00,0X00,0X00,0X01,0X80,0X10,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X10,0X1C,0X00,0X00,0X00,0X01,0X80,0X30,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X14,0X00,0X00,0X00,0X01,0X80,0X30,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X0C,0X24,0X00,0X00,0X00,0X01,0X80,0X30,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X07,0XC6,0X00,0X00,0X00,0X01,0X80,0X30,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X0C,0X66,0X00,0X00,0X00,0X01,0X80,0X30,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X08,0X1C,0X00,0X00,0X00,0X01,0X80,0X30,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X10,0X08,0X00,0X00,0X00,0X00,0X80,0X30,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X10,0X08,0X00,0X00,0X00,0X03,0X40,0X30,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X30,0X0C,0X00,0X00,0X00,0X03,0X20,0X30,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X10,0X0C,0X00,0X00,0X00,0X03,0X1F,0XB0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X10,0X0C,0X00,0X00,0X00,0X03,0X00,0X30,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X08,0X00,0X00,0X00,0X03,0X00,0X30,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X0C,0X18,0X00,0X00,0X00,0X02,0X00,0X30,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X07,0X70,0X00,0X00,0X00,0X02,0X00,0X30,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X01,0XC0,0X00,0X40,0X00,0X02,0X00,0X20,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X1F,0XFF,0X00,0X02,0X00,0X20,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0XFF,0XFF,0XE0,0X02,0X00,0X20,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X01,0XFF,0XFF,0XF8,0X06,0X00,0X20,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X07,0XFF,0XFF,0XFE,0X06,0X00,0X20,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X0F,0XFF,0XFF,0XFF,0X06,0X00,0X20,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X1F,0XFF,0XFF,0XFF,0XC6,0X00,0X20,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X3F,0XFF,0XFF,0XFF,0XE6,0X00,0X20,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X7F,0XFD,0X20,0X7F,0XF6,0X00,0X20,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0XFF,0XF1,0X20,0X0F,0XF4,0X00,0X20,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X08,0XFF,0XC1,0X20,0X07,0XFC,0X00,0X20,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X0D,0XFF,0X81,0X30,0X01,0XFC,0X00,0X60,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X09,0XFE,0X01,0X30,0X03,0XFC,0X00,0X60,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X0B,0XFC,0X01,0X30,0X06,0X7C,0X00,0X60,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X13,0XFC,0X01,0X90,0X0C,0X7C,0X00,0X60,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X37,0XFC,0X01,0X90,0X08,0XDC,0X00,0X60,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X27,0XF3,0X01,0X90,0X10,0X8C,0X00,0X60,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X1F,0XE1,0X80,0X90,0X31,0X0C,0X00,0X60,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X1F,0XF0,0XC0,0X92,0X62,0X0C,0X00,0X40,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X0F,0XCC,0X6F,0XFF,0XE6,0X04,0X00,0X40,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X0F,0XC6,0X7F,0XFF,0XFC,0X0C,0X00,0X40,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X0F,0XC3,0XFF,0XFF,0XFF,0X8C,0X00,0X40,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X0F,0X87,0XFF,0XFF,0XFF,0XEC,0X00,0X40,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X1F,0X8F,0XFF,0XFF,0XFF,0XFC,0X00,0X40,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X1F,0X9F,0XFF,0XFF,0XFF,0XFC,0X00,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X3F,0XBF,0XFF,0XFF,0XFF,0XFE,0X00,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X3F,0XFF,0XFF,0XFF,0XFF,0XFF,0X80,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X1F,0XFF,0XFF,0X65,0XFF,0XFF,0XC0,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X3F,0XFF,0XF3,0XC4,0X0F,0XFF,0XC0,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X7F,0XFF,0XC6,0XE5,0XF9,0XFF,0XE0,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XFF,0XFF,0X0C,0XE5,0X08,0X7F,0XF0,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X3F,0XFF,0X19,0X66,0X10,0X3F,0XF8,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X3F,0XFC,0XB2,0X65,0X10,0X1F,0XFC,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X1F,0XF8,0XE4,0X65,0X30,0X1F,0XFC,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X7F,0XE8,0X4C,0X64,0XB0,0X37,0XFE,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X3F,0XD4,0X68,0X64,0X60,0X61,0XFE,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X2F,0X9C,0X30,0XE6,0X60,0XC1,0XFF,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X41,0X0E,0X30,0XA6,0X60,0X83,0XFF,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X7D,0X87,0X10,0XA5,0X41,0X07,0X7F,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X73,0XC3,0X18,0XA4,0XC3,0X0F,0X3F,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X62,0X60,0X88,0XA4,0XC6,0X1B,0X3F,0XB0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X66,0X30,0X4F,0XE6,0X8C,0X33,0X1F,0XF0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X44,0X1C,0X64,0X34,0X88,0X63,0X1F,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XC4,0X0E,0X26,0X04,0X98,0XC3,0X0F,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X68,0X03,0XB2,0X36,0XB1,0X83,0X0F,0XFE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XC8,0X00,0XF3,0XF7,0X23,0X03,0X0F,0XDE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XC8,0X00,0X19,0X11,0X46,0X03,0X0F,0XDE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X38,0X00,0X0C,0X93,0X8C,0X02,0X0F,0XFE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X00,0X04,0XFF,0X1C,0X02,0X0F,0XFE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X78,0X00,0X02,0XCB,0X34,0X02,0X07,0XFE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X30,0X00,0X03,0X11,0X24,0X02,0X07,0XFE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XF0,0X00,0X03,0X14,0XC4,0X02,0X07,0XFE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XFF,0XFF,0XFE,0X1C,0X4F,0XFF,0XFF,0XFF,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X70,0X0C,0XFE,0X1E,0X7F,0XF0,0X4F,0XE1,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XF0,0X00,0X02,0X3C,0X20,0X00,0X0F,0XE1,0X80,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XF8,0X00,0X02,0X33,0X30,0X00,0X0F,0XE0,0X80,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XFF,0XFF,0XFE,0X33,0X3F,0XFF,0XCF,0XC0,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XFF,0X80,0X02,0X3F,0X28,0X0D,0XFF,0XC0,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XF8,0X00,0X03,0X1E,0X60,0X08,0X0F,0XC0,0X60,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XFC,0X00,0X03,0X0A,0X70,0X08,0X0F,0XC0,0X20,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XFC,0X00,0X06,0X86,0X98,0X10,0X0F,0XC0,0X30,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XFC,0X00,0X04,0XC7,0XCC,0X20,0X1F,0XE0,0X10,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XFC,0X00,0X09,0XBD,0X66,0X60,0X1F,0XE0,0X18,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XFE,0X00,0X1B,0X0D,0X31,0XA0,0X1F,0XB0,0X08,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XFE,0X00,0X32,0X09,0X18,0XE0,0X3F,0X90,0X0C,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0XFF,0X00,0X26,0X09,0X8C,0X60,0X3F,0X98,0X0E,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X7F,0X00,0X6C,0X09,0X86,0X38,0X3F,0X08,0X07,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X7F,0X80,0XC8,0X0C,0X87,0X1C,0X7F,0X0C,0X01,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X7F,0X81,0X98,0X0C,0X89,0X86,0X7F,0X0C,0X01,0X80,0X00,0X00,0X00,0X00,0X00,
0X00,0X3F,0XC1,0X30,0X0C,0X98,0XC3,0XFF,0X06,0X00,0XC0,0X00,0X00,0X00,0X00,0X00,
0X00,0X3F,0XE2,0X20,0X0C,0XD0,0X61,0XFD,0X06,0X00,0X40,0X00,0X00,0X00,0X00,0X00,
0X00,0X1F,0XF6,0X60,0X0C,0XE0,0X33,0XFD,0X03,0X00,0X60,0X00,0X00,0X00,0X00,0X00,
0X00,0X1F,0XFC,0X40,0X04,0XFF,0XF3,0XFA,0X01,0X80,0X30,0X00,0X00,0X00,0X00,0X00,
0X00,0X0F,0XFC,0XC0,0X04,0X40,0X2F,0XF2,0X00,0XC0,0X18,0X00,0X00,0X00,0X00,0X00,
0X00,0X07,0XFF,0X80,0X04,0X40,0X0F,0XF6,0X00,0XC0,0X18,0X00,0X00,0X00,0X00,0X00,
0X00,0X07,0XFF,0X00,0X04,0X40,0X1F,0XF2,0X00,0X60,0X0C,0X00,0X00,0X00,0X00,0X00,
0X00,0X03,0XFF,0X80,0X06,0X40,0X3F,0XFF,0XA0,0X30,0X06,0X00,0X00,0X00,0X00,0X00,
0X00,0X01,0XFF,0XE0,0X06,0X60,0XFF,0X07,0XFC,0X18,0X03,0X00,0X00,0X00,0X00,0X00,
0X00,0X70,0XFF,0XFC,0X06,0X67,0XFE,0X07,0XC7,0XFC,0X03,0X80,0X00,0X00,0X00,0X00,
0X00,0X5C,0X7F,0XFF,0X87,0XFF,0XFC,0X07,0XC0,0X03,0X01,0X80,0X00,0X00,0X00,0X00,
0X00,0X5F,0X9F,0XFF,0XFF,0XFF,0XF8,0X07,0XC0,0X81,0X80,0X80,0X07,0X03,0X80,0X00,
0X00,0XBF,0X7F,0XFF,0XFF,0XFF,0XF8,0X07,0XC0,0X40,0X01,0X81,0XFF,0XCC,0X80,0X00,
0X00,0XBE,0X0F,0XFF,0XFF,0XFF,0XFC,0X03,0XC0,0X00,0X06,0X83,0XF8,0X68,0X80,0X00,
0X00,0X7F,0X03,0XFF,0XFF,0XFF,0XE6,0X03,0XC0,0X00,0X04,0X8F,0XFE,0X31,0X00,0X00,
0X00,0X7E,0X39,0XFF,0XFF,0XFE,0XC2,0X03,0XC0,0X00,0X06,0X9F,0XFF,0XF3,0X80,0X00,
0X00,0X3E,0XC6,0X7F,0XFF,0XF1,0X92,0X03,0XC0,0X00,0X03,0XFF,0XFF,0X93,0X60,0X00,
0X00,0X7E,0X19,0X10,0X7A,0X03,0X2D,0X03,0XC0,0X00,0X00,0XBF,0XFF,0XF5,0X20,0X00,
0X00,0X7E,0X07,0X4C,0X40,0X06,0X11,0X03,0XC0,0X00,0X01,0X3F,0XFF,0XFD,0X30,0X00,
0X00,0X7E,0X00,0XB7,0X40,0X0C,0X21,0X83,0XC0,0X00,0X03,0X3F,0XFF,0XFD,0X18,0X00,
0X00,0X7E,0X00,0X69,0XC0,0X18,0XC0,0X81,0XE0,0X00,0X02,0X3F,0XFF,0XCC,0X8C,0X00,
0X00,0XFF,0X00,0X36,0X60,0X31,0X80,0X81,0XE0,0X00,0X06,0X7F,0XFF,0XFC,0X8C,0X00,
0X00,0XFE,0X00,0X05,0X30,0X63,0X00,0X81,0XE0,0X00,0X03,0X7F,0XFF,0XFC,0X86,0X00,
0X00,0XFC,0XE0,0X02,0XDC,0X52,0X00,0X81,0X20,0X00,0X01,0XFF,0XFF,0XFC,0X82,0X00,
0X00,0XBC,0X38,0X01,0XA6,0X84,0X00,0X81,0X10,0X00,0X01,0XFF,0XFF,0XFC,0XC3,0X00,
0X00,0XBC,0X36,0X00,0X53,0XC8,0X00,0X81,0X1F,0XC0,0X03,0XFF,0XFF,0XFC,0X43,0X00,
0X00,0XFC,0X63,0X80,0X21,0XD0,0X00,0X9F,0X34,0X7F,0XFF,0X7F,0XFF,0XFC,0X21,0X80,
0X00,0X7C,0X40,0XE0,0X19,0X60,0X00,0XF1,0XE0,0X63,0X18,0XE7,0XFE,0X06,0X21,0X80,
0X00,0X78,0XC0,0X30,0X07,0X20,0X0E,0X81,0XF0,0X02,0X00,0X40,0XFE,0X06,0X11,0X80,
0X00,0X79,0X80,0X18,0X02,0X20,0X1C,0X81,0XE0,0X0F,0XC4,0X40,0X7F,0X04,0X0D,0X80,
0X00,0X39,0X00,0X16,0X06,0X60,0X71,0X01,0XEF,0XFF,0XFE,0XC0,0X7E,0X0C,0X01,0X80,
0X00,0X1A,0X00,0X23,0X04,0XC0,0XC3,0XFF,0XF3,0XC0,0X00,0XC0,0X7C,0X0F,0XFF,0X00,
0X00,0X04,0X00,0X61,0XC0,0X03,0X0E,0X7E,0X00,0X00,0X01,0X80,0X3F,0X39,0XDC,0X00,
0X00,0X0C,0X00,0XC0,0X60,0X06,0X38,0X0C,0X08,0X23,0X81,0X80,0X01,0XE0,0X00,0X00,
0X00,0X08,0X00,0X80,0X30,0X18,0X70,0X30,0X08,0X3F,0XFF,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X01,0X00,0XFC,0X71,0XC0,0X60,0X08,0XF0,0X0E,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X03,0X03,0X8F,0XC3,0X00,0X80,0X09,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X06,0X0F,0X03,0X0E,0X01,0X00,0X0F,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X04,0X38,0X00,0X18,0X01,0X00,0X38,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X0C,0XE0,0X00,0X70,0X03,0XF0,0X60,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X0F,0X80,0X00,0X60,0X07,0XFC,0X40,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X1E,0X00,0X00,0XC0,0X07,0XFE,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X18,0X38,0X00,0X0F,0X80,0X07,0XFF,0X00,0X00,0X0C,0X00,0X00,0X00,0X00,0X00,
0X00,0X10,0XE0,0X00,0X3F,0XFF,0XE7,0XFF,0X00,0X00,0X1F,0XFF,0X7E,0X00,0X00,0X00,
0X00,0X11,0XC0,0X00,0XFF,0XFF,0XF7,0XFF,0X00,0X00,0X0F,0XF3,0XFE,0X00,0X00,0X00,
0X00,0X3A,0X00,0X03,0X80,0X01,0XFF,0XFF,0XFF,0XFF,0XF8,0X63,0X26,0X00,0X00,0X00,
0X00,0X7C,0X04,0X0E,0X00,0X00,0X0F,0XFF,0X9E,0X03,0XF8,0XAA,0X13,0X00,0X00,0X00,
0X00,0X7E,0X04,0X38,0X00,0X00,0X0F,0XFF,0X80,0X7F,0X8F,0XD6,0XC3,0X00,0X00,0X00,
0X00,0XFF,0X04,0XE0,0X00,0X00,0X07,0XFE,0X00,0X00,0X0F,0XFF,0XFF,0X00,0X00,0X00,
0X00,0X8F,0X07,0X80,0X00,0X00,0X02,0XFE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X47,0X86,0X00,0X00,0X00,0X00,0X0C,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X67,0XCE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X1B,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X09,0XF0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X0C,0XF0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X04,0X7C,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X02,0X3E,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X03,0X0F,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X01,0X87,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0XF3,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X18,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00  
};

const unsigned char ris_1[]PROGMEM = {//корабль вправо
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0X60,0X18,0X00,0X00,0X00,0X3E,
0X7C,0X30,0XC0,0X00,0X00,0X3E,0X6C,0X21,0XE0,0X00,0X00,0X7C,0XC7,0X3F,0XFF,0X00,
0X00,0XE8,0XFF,0XFF,0XE6,0X00,0X03,0X96,0XE7,0XC1,0XC6,0X00,0X0F,0X9E,0XE3,0XC0,
0X46,0X00,0X1E,0X12,0XE3,0X80,0X06,0X00,0X1C,0X16,0XE7,0X80,0X06,0X00,0X3C,0X9E,
0XE7,0X00,0X00,0X00,0X34,0X96,0XE6,0X00,0X00,0X00,0X24,0X96,0XC6,0X04,0X00,0X80,
0X24,0X99,0X04,0X1E,0X03,0X80,0X24,0XB1,0XE4,0XFD,0XFF,0X00,0X2C,0XE7,0XFF,0XF9,
0XFF,0X00,0X2C,0XCE,0X7F,0X88,0XFE,0X00,0X2C,0X9C,0X63,0X88,0XFE,0X9E,0X2C,0X98,
0X63,0XD8,0XFF,0XFE,0X2C,0XBB,0X7A,0X1F,0XFE,0X9E,0X2C,0XBF,0XFD,0X98,0X7E,0X9E,
0X24,0XA1,0X31,0X98,0X7F,0X9E,0X24,0XA0,0X30,0X1A,0X7F,0X9C,0X24,0XA0,0XB1,0X98,
0XFF,0X9C,0X24,0XB0,0XBC,0X2E,0XFE,0X1C,0X24,0XD0,0XBD,0XCC,0XFC,0X1C,0X24,0X98,
0XF3,0XF8,0X00,0X00,0X24,0X40,0XFB,0XF0,0X00,0X00,0X16,0XF0,0X9F,0X80,0X00,0X00,
0X12,0X18,0X00,0X00,0X00,0X00,0X1A,0X0C,0X00,0X7C,0X0F,0X80,0X1E,0X5D,0XFF,0XEF,
0XFF,0X00,0X0F,0X7C,0XFF,0XE7,0XF1,0X00,0X07,0X04,0XFF,0XE5,0XE1,0X00,0X03,0XFD,
0XFF,0XE7,0XC3,0X00,0X00,0XFC,0X3F,0XFF,0X83,0X80,0X00,0X3E,0X5F,0XE0,0X01,0X80,
0X00,0X1E,0X7F,0XE0,0X00,0X00,0X00,0X07,0X3F,0X80,0X00,0X00,0X00,0X03,0X3E,0X00,
0X00,0X00,0X00,0X02,0X00,0X00,0X00,0X00,0X00,0X03,0X00,0X00,0X00,0X00,0X00,0X03,
0X80,0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,

0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0X60,0X18,0X00,0X00,0X00,0X3E,
0X7C,0X30,0XC0,0X00,0X00,0X3E,0X6C,0X21,0XE0,0X00,0X00,0X7C,0XC7,0X3F,0XFF,0X00,
0X00,0XE8,0XFF,0XFF,0XE0,0X00,0X03,0XFC,0XE7,0XC1,0XC0,0X00,0X0F,0XFC,0XE3,0XC0,
0X40,0X00,0X1F,0XFC,0XE3,0X80,0X00,0X00,0X1F,0XFC,0XE7,0X80,0X00,0X00,0X1F,0XFC,
0XE7,0X00,0X00,0X00,0X3F,0XFC,0XE6,0X00,0X00,0X00,0X3F,0XFE,0XC6,0X04,0X00,0X80,
0X3F,0XF9,0X04,0X1E,0X03,0X80,0X3F,0XF1,0XE4,0XFD,0XFF,0X00,0X3F,0XE7,0XFF,0XF9,
0XFF,0X00,0X3F,0XCE,0X7F,0X88,0XFE,0X00,0X3F,0X9C,0X63,0X88,0XFE,0X80,0X3F,0X98,
0X63,0XD8,0XFF,0XE0,0X3F,0X3B,0X7A,0X1F,0XFE,0X80,0X3F,0X3F,0XFD,0X98,0X7E,0X80,
0X3F,0X21,0X31,0X98,0X7F,0X80,0X3F,0X20,0X30,0X1A,0X7F,0X80,0X3F,0X20,0XB1,0X98,
0XFF,0X80,0X3F,0X30,0XBC,0X2E,0XFE,0X00,0X3F,0X90,0XBD,0XCC,0XFC,0X00,0X3F,0X98,
0XF3,0XF8,0X00,0X00,0X3F,0XC0,0XFB,0XF0,0X00,0X00,0X1F,0XF0,0X9F,0X80,0X00,0X00,
0X1F,0XF8,0X00,0X00,0X00,0X00,0X0F,0XFC,0X00,0X7C,0X0F,0X80,0X1F,0XFD,0XFF,0XEF,
0XFC,0X00,0X0F,0XFC,0XFF,0XE7,0XF0,0X00,0X07,0XFC,0XFF,0XE5,0XE0,0X00,0X03,0XFD,
0XFF,0XE7,0XC0,0X00,0X00,0XFC,0X3F,0XFF,0X80,0X00,0X00,0X3E,0X5F,0XE0,0X00,0X00,
0X00,0X1E,0X7F,0XE0,0X00,0X00,0X00,0X07,0X3F,0X80,0X00,0X00,0X00,0X03,0X3E,0X00,
0X00,0X00,0X00,0X02,0X00,0X00,0X00,0X00,0X00,0X03,0X00,0X00,0X00,0X00,0X00,0X03,
0X80,0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00
};
const unsigned char ris_2[]PROGMEM = {//корабль влево
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00,0X00,0X00,0X03,0X80,0X00,
0X00,0X00,0X00,0X03,0X00,0X00,0X00,0X00,0X00,0X02,0X00,0X00,0X00,0X00,0X00,0X03,
0X3E,0X00,0X00,0X00,0X00,0X07,0X3F,0X80,0X00,0X00,0X00,0X1E,0X7F,0XE0,0X00,0X00,
0X00,0X3E,0X5F,0XE0,0X01,0X80,0X00,0XFC,0X3F,0XFF,0X83,0X80,0X03,0XFD,0XFF,0XE7,
0XC3,0X00,0X07,0X04,0XFF,0XE5,0XE1,0X00,0X0F,0X7C,0XFF,0XE7,0XF1,0X00,0X1E,0X5D,
0XFF,0XEF,0XFF,0X00,0X1A,0X0C,0X00,0X7C,0X0F,0X80,0X12,0X18,0X00,0X00,0X00,0X00,
0X16,0XF0,0X9F,0X80,0X00,0X00,0X24,0X40,0XFB,0XF0,0X00,0X00,0X24,0X98,0XF3,0XF8,
0X00,0X00,0X24,0XD0,0XBD,0XCC,0XFC,0X1C,0X24,0XB0,0XBC,0X2E,0XFE,0X1C,0X24,0XA0,
0XB1,0X98,0XFF,0X9C,0X24,0XA0,0X30,0X1A,0X7F,0X9C,0X24,0XA1,0X31,0X98,0X7F,0X9E,
0X2C,0XBF,0XFD,0X98,0X7E,0X9E,0X2C,0XBB,0X7A,0X1F,0XFE,0X9E,0X2C,0X98,0X63,0XD8,
0XFF,0XFE,0X2C,0X9C,0X63,0X88,0XFE,0X9E,0X2C,0XCE,0X7F,0X88,0XFE,0X00,0X2C,0XE7,
0XFF,0XF9,0XFF,0X00,0X24,0XB1,0XE4,0XFD,0XFF,0X00,0X24,0X99,0X04,0X1E,0X03,0X80,
0X24,0X96,0XC6,0X04,0X00,0X80,0X34,0X96,0XE6,0X00,0X00,0X00,0X3C,0X9E,0XE7,0X00,
0X00,0X00,0X1C,0X16,0XE7,0X80,0X06,0X00,0X1E,0X12,0XE3,0X80,0X06,0X00,0X0F,0X9E,
0XE3,0XC0,0X46,0X00,0X03,0X96,0XE7,0XC1,0XC6,0X00,0X00,0XE8,0XFF,0XFF,0XE6,0X00,
0X00,0X7C,0XC7,0X3F,0XFF,0X00,0X00,0X3E,0X6C,0X21,0XE0,0X00,0X00,0X3E,0X7C,0X30,
0XC0,0X00,0X00,0X03,0X60,0X18,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,

0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00,0X00,0X00,0X03,0X80,0X00,
0X00,0X00,0X00,0X03,0X00,0X00,0X00,0X00,0X00,0X02,0X00,0X00,0X00,0X00,0X00,0X03,
0X3E,0X00,0X00,0X00,0X00,0X07,0X3F,0X80,0X00,0X00,0X00,0X1E,0X7F,0XE0,0X00,0X00,
0X00,0X3E,0X5F,0XE0,0X00,0X00,0X00,0XFC,0X3F,0XFF,0X80,0X00,0X03,0XFD,0XFF,0XE7,
0XC0,0X00,0X07,0XFC,0XFF,0XE5,0XE0,0X00,0X0F,0XFC,0XFF,0XE7,0XF0,0X00,0X1F,0XFD,
0XFF,0XEF,0XFC,0X00,0X0F,0XFC,0X00,0X7C,0X0F,0X80,0X1F,0XF8,0X00,0X00,0X00,0X00,
0X1F,0XF0,0X9F,0X80,0X00,0X00,0X3F,0XC0,0XFB,0XF0,0X00,0X00,0X3F,0X98,0XF3,0XF8,
0X00,0X00,0X3F,0X90,0XBD,0XCC,0XFC,0X00,0X3F,0X30,0XBC,0X2E,0XFE,0X00,0X3F,0X20,
0XB1,0X98,0XFF,0X80,0X3F,0X20,0X30,0X1A,0X7F,0X80,0X3F,0X21,0X31,0X98,0X7F,0X80,
0X3F,0X3F,0XFD,0X98,0X7E,0X80,0X3F,0X3B,0X7A,0X1F,0XFE,0X80,0X3F,0X98,0X63,0XD8,
0XFF,0XE0,0X3F,0X9C,0X63,0X88,0XFE,0X80,0X3F,0XCE,0X7F,0X88,0XFE,0X00,0X3F,0XE7,
0XFF,0XF9,0XFF,0X00,0X3F,0XF1,0XE4,0XFD,0XFF,0X00,0X3F,0XF9,0X04,0X1E,0X03,0X80,
0X3F,0XFE,0XC6,0X04,0X00,0X80,0X3F,0XFC,0XE6,0X00,0X00,0X00,0X1F,0XFC,0XE7,0X00,
0X00,0X00,0X1F,0XFC,0XE7,0X80,0X00,0X00,0X1F,0XFC,0XE3,0X80,0X00,0X00,0X0F,0XFC,
0XE3,0XC0,0X40,0X00,0X03,0XFC,0XE7,0XC1,0XC0,0X00,0X00,0XE8,0XFF,0XFF,0XE0,0X00,
0X00,0X7C,0XC7,0X3F,0XFF,0X00,0X00,0X3E,0X6C,0X21,0XE0,0X00,0X00,0X3E,0X7C,0X30,
0XC0,0X00,0X00,0X03,0X60,0X18,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00
};
const unsigned char ris_3[]PROGMEM = {// ядро пушки
0X00,0X18,0X0A,0X7E,0X14,0XE7,0X02,0XD3,0X02,0XFF,0X14,0XFF,0X0A,0X7E,0X00,0X18,

0X00,0X18,0X00,0X7E,0X00,0XFF,0X00,0XFF,0X00,0XFF,0X00,0XFF,0X00,0X7E,0X00,0X18
};
const unsigned char ris_4[]PROGMEM = {//обломкм корабля
 0X00,0X00,0X00,0X00,0X20,0X00,0X01,0X81,0X08,0XFC,0X38,0X00,0X1F,0X83,0XFF,0XFF,
0XF8,0X00,0X3F,0X83,0XFC,0X1F,0XE0,0X00,0X3F,0X0F,0XFE,0X7C,0X00,0X30,0X38,0X09,
0XFE,0X60,0X00,0X70,0X38,0XE3,0XFF,0X60,0X00,0X70,0X79,0XC7,0XFF,0X80,0X10,0X3C,
0X73,0XCF,0XF0,0X00,0X7F,0X3C,0X33,0XE7,0XC0,0X01,0XFF,0X30,0X07,0X27,0X07,0XF9,
0XFF,0X80,0X0C,0X74,0X1F,0XDD,0XFE,0X00,0X19,0XF0,0X37,0X88,0X78,0X30,0X1D,0X11,
0X61,0X1A,0X60,0XF8,0X38,0X31,0XFC,0X9C,0X03,0XF8,0X3C,0X20,0XBD,0X8C,0X07,0XE0,
0X34,0XC8,0XB0,0XC8,0X0F,0X80,0X36,0X58,0XD8,0XE0,0X0E,0X00,0X14,0X88,0X5F,0X00,
0X1C,0X00,0X0A,0X58,0X1C,0X0F,0XFF,0XF0,0X0B,0X58,0X70,0X7F,0XFF,0XF0,0X13,0X69,
0XC3,0XFF,0XFF,0XF0,0X12,0X66,0X1F,0XFF,0XF8,0X00,0X36,0X4C,0X1F,0XFF,0XE0,0X00,
0X2C,0X4D,0X0F,0XE7,0XFF,0XE0,0X24,0XCC,0X87,0XF0,0X3F,0XF0,0X44,0XCC,0X78,0XFE,
0X07,0XF0,0X49,0XE6,0X60,0X3F,0XF8,0X30,0X69,0X26,0X63,0X07,0XFC,0X00,0X73,0X33,
0XF3,0XD0,0X7F,0X80,0X72,0X42,0XFF,0X1E,0X0F,0XFC,0X70,0X58,0X0F,0X19,0X83,0XFE,
0X30,0X7B,0X13,0X91,0XC0,0XFE,0X1C,0X93,0X91,0XE1,0XFC,0X0E,0X0C,0X93,0X18,0X77,
0XFF,0X00,0X0C,0XF7,0X30,0X77,0XFB,0XE0,0X06,0X67,0X38,0X3B,0XF8,0X78,0X67,0X8E,
0X1C,0X00,0X7C,0X78,0X77,0X8E,0X38,0X00,0X18,0X18,0X77,0XCB,0X7C,0X00,0X1C,0X00,
0X78,0XC8,0XF8,0X00,0X0C,0X00,0X38,0XDD,0XF8,0X00,0X00,0X00,0X3C,0X1F,0X87,0X08,
0XE0,0X00,0X3F,0X01,0X0F,0XF8,0XE0,0X00,0X1F,0XC0,0X08,0XF8,0XC0,0X00,0X0F,0XE0,
0X0C,0X79,0XC0,0X00,0X00,0XC0,0X04,0X3F,0X80,0X00,0X00,0X00,0X00,0X00,0X80,0X00,

 0X00,0X00,0X00,0X00,0X20,0X00,0X00,0X01,0X08,0XFC,0X38,0X00,0X00,0X03,0XFF,0XFF,
0XF8,0X00,0X00,0X03,0XFC,0X1F,0XE0,0X00,0X00,0X0F,0XFE,0X7C,0X00,0X30,0X00,0X09,
0XFE,0X60,0X00,0X70,0X00,0XE3,0XFF,0X60,0X00,0X70,0X01,0XC7,0XFF,0X80,0X10,0X3C,
0X03,0XCF,0XF0,0X00,0X7F,0X3C,0X03,0XE7,0XC0,0X01,0XFF,0X30,0X07,0XE7,0X07,0XF9,
0XFF,0X80,0X0F,0XF4,0X1F,0XDD,0XFE,0X00,0X1F,0XF0,0X3F,0X88,0X78,0X00,0X1F,0XF1,
0X7F,0X1A,0X60,0X00,0X3F,0XF1,0XFF,0X9C,0X00,0X00,0X3F,0XE0,0XBF,0X8C,0X00,0X00,
0X37,0XE8,0XBF,0XC8,0X00,0X00,0X37,0XD8,0XDF,0XE0,0X00,0X00,0X17,0X88,0X5F,0X00,
0X00,0X00,0X0B,0XD8,0X1C,0X00,0X00,0X00,0X0B,0XD8,0X70,0X00,0X00,0X00,0X13,0XF9,
0XC0,0X00,0X00,0X00,0X13,0XFE,0X00,0X00,0X00,0X00,0X37,0XFC,0X00,0X00,0X00,0X00,
0X2F,0XFD,0X00,0X00,0X00,0X00,0X27,0XFC,0X80,0X00,0X00,0X00,0X47,0XFC,0X78,0X00,
0X00,0X00,0X4F,0XFE,0X60,0X00,0X00,0X00,0X6F,0XFE,0X63,0X00,0X00,0X00,0X7F,0XFF,
0XF3,0XD0,0X00,0X00,0X7F,0XFF,0XFF,0X1E,0X00,0X00,0X7F,0XFF,0XFF,0X1F,0X80,0X00,
0X3F,0XFF,0XF3,0X9F,0XC0,0X00,0X1F,0X9F,0XF1,0XFF,0XFC,0X00,0X0F,0X9F,0XF8,0X7F,
0XFF,0X00,0X0F,0XFF,0XF0,0X7F,0XFB,0XE0,0X07,0XFF,0XF8,0X3B,0XF8,0X78,0X07,0XFF,
0XFC,0X00,0X7C,0X78,0X07,0XFF,0XF8,0X00,0X18,0X18,0X07,0XFB,0XFC,0X00,0X1C,0X00,
0X00,0XF8,0XF8,0X00,0X0C,0X00,0X00,0XFD,0XF8,0X00,0X00,0X00,0X00,0X1F,0X87,0X08,
0XE0,0X00,0X00,0X01,0X0F,0XF8,0XE0,0X00,0X00,0X00,0X08,0XF8,0XC0,0X00,0X00,0X00,
0X0C,0X79,0XC0,0X00,0X00,0X00,0X04,0X3F,0X80,0X00,0X00,0X00,0X00,0X00,0X80,0X00
};

 

andycat
andycat аватар
Offline
Зарегистрирован: 07.09.2017

добавил рисование графических примитивов и текста

#include <avr/pgmspace.h>
#include "tft9341.h"
#include "bgimg.h"

void setup() {
	randomSeed(analogRead(0));
  Serial.begin(115200);
  // put your setup code here, to run once:
  tftInit(240, 320, ROTATE_0);
  // test fill screen
  Serial.print("fillscreen time = ");
  unsigned long starttime = millis();
  tftFillScreen(TFT9341_BLACK);
  Serial.println(millis() - starttime);
  // draw image
  /*Serial.print("image 240*320 4 colors time = ");
  starttime = millis();
  tftDrawImagePGM(bg240320bpp2, pal2bpp, 2, 0, 0, 239, 319);
  Serial.println(millis() - starttime);*/
  Serial.print("image 120*160 16 colors time = ");
  starttime = millis();
  tftDrawImagePGM(bg120160bpp4, pal4bppInv, 4, 0, 0, 119, 159);
  Serial.println(millis() - starttime);
  tftDrawImagePGM(bg120160bpp4, pal4bpp, 4, 100, 100, 219, 259);
  // test graphic simple
  /*tftDrawLine(50, 50, 50, 150, TFT9341_YELLOW);
  tftDrawLine(100, 100, 200, 100, TFT9341_WHITE);
  tftDrawLine(70, 120, 229, 310, TFT9341_GREEN);
  tftDrawRect(113, 113, 168, 183, TFT9341_CYAN);
  tftDrawCirc(120, 160, 97, TFT9341_RED);
  tftDrawTria(10, 50, 183, 171, 60, 154, TFT9341_MAGENTA);
  tftDrawPixel(115, 299, TFT9341_WHITE);*/
  starttime = millis();
  unsigned short countSimples = 0;
  while ((millis() - starttime) < 1000UL) {
	  ++countSimples;
	  switch (random(5)) {
		  case 0: {
			  tftDrawLine(random(240), random(320), random(240), random(320), random(65535));
			  break;
			}
		  case 1: {
			  tftDrawRect(random(240), random(320), random(240), random(320), random(65535));
			  break;
		  }
		  case 2: {
			  tftDrawTria(random(240), random(320), random(240), random(320), random(240), random(320), random(65535));
			  break;
		  }
		  case 3: {
			  tftDrawCirc(random(120), random(160), random(120), random(65535));
			  break;
		  }
		  case 4: {
			  tftDrawPixel(random(240), random(320), random(65535));
			  break;
			}
		  default:{}
	  }
  }
  Serial.print("simples primitiv per sec = "); Serial.println(countSimples);
  // test text
  tftDrawChar(9, 180, 'F', TFT9341_BLACK, TFT9341_WHITE);
  tftDrawChar(12, 190, 't', TFT9341_YELLOW, TFT9341_RED);
  tftPrintStr(5, 210, (unsigned char*)"Hello world!", TFT9341_YELLOW, TFT9341_BLACK);
  tftPrintRusUTF8(27, 240, (unsigned char*)"Привет МИР!", TFT9341_BLUE, TFT9341_YELLOW);
}

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


//tft9341.h
#ifndef TFT9341_H_
#define TFT9341_H_

#define TFT9341_BLACK   0x0000
#define TFT9341_BLUE    0x001F
#define TFT9341_RED     0xF800
#define TFT9341_GREEN   0x07E0
#define TFT9341_CYAN    0x07FF
#define TFT9341_MAGENTA 0xF81F
#define TFT9341_YELLOW  0xFFE0
#define TFT9341_WHITE   0xFFFF

enum TFT9341_ROTATE_t {ROTATE_0, ROTATE_90, ROTATE_180, ROTATE_270};

void tftInit(unsigned short w_size, unsigned short h_size, enum TFT9341_ROTATE_t locTFT9341_ROTATE);
void tftFillRect(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, unsigned short color);
void tftFillScreen(unsigned short color);
void tftDrawImagePGM(const unsigned char * sourceImage, const unsigned char * palitraSrc, const unsigned char bitsPerPixel,
    unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2);
void tftDrawLine(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, unsigned short color);
void tftDrawRect(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, unsigned short color);
void tftDrawCirc(unsigned short xc, unsigned short yc, unsigned short r, unsigned short color);
void tftDrawTria(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, unsigned short x3, unsigned short y3, unsigned short color);
void tftDrawPixel(unsigned short x, unsigned short y, unsigned short color);
void tftDrawChar(unsigned short x, unsigned short y, unsigned char inChar, unsigned short color, unsigned short bgcol);
void tftPrintStr(unsigned short x, unsigned short y, unsigned char * inString, unsigned short color, unsigned short bgcol);
void tftPrintRusUTF8(unsigned short x, unsigned short y, unsigned char* inString, unsigned short color, unsigned short bgcol);

#endif /* TFT9341_H_ */


//tft9341.cpp
#include <avr/pgmspace.h>
#include "tft9341.h"
#include <arduino.h>
#include "SPI.h"
#include "FR08x08.h"

unsigned short tftWIDTH;
unsigned short tftHEIGHT;

//-------------------------------------------------------------------
#define tft_cs_pin 10
#define tft_dc_pin 9
//-------------------------------------------------------------------
#define TFT9341_MADCTL_MY  0x80
#define TFT9341_MADCTL_MX  0x40
#define TFT9341_MADCTL_MV  0x20
#define TFT9341_MADCTL_ML  0x10
#define TFT9341_MADCTL_RGB 0x00
#define TFT9341_MADCTL_BGR 0x08
#define TFT9341_MADCTL_MH  0x04
#define TFT9341_ROTATION (TFT9341_MADCTL_MX | TFT9341_MADCTL_BGR)
//-------------------------------------------------------------------
#define swap(a,b) {int16_t t=a;a=b;b=t;}
//-------------------------------------------------------------------

void tftSetPinCS(unsigned char AstatePin) {
  digitalWrite(tft_cs_pin, AstatePin);
}

void tftSetPinDC(unsigned char AstatePin) {
  digitalWrite(tft_dc_pin, AstatePin);
}

void tftSendCommand(unsigned char cmd) {
  tftSetPinDC(0);
  tftSetPinCS(0); // говорим slave устройству что начинаем работать
  SPI.transfer(cmd);
  tftSetPinCS(1); // end transfer
}

void tftWriteData(unsigned char * buff, unsigned short buff_size) {
  tftSetPinDC(1);
  tftSetPinCS(0); // говорим slave устройству что начинаем работать
  for (unsigned short i = 0; i < buff_size; ++i) {
    SPI.transfer(buff[i]);
  }
  tftSetPinCS(1); // end transfer
}

void tftSetAddrWindow(unsigned short x0, unsigned short y0, unsigned short x1, unsigned short y1) {
  static unsigned char pos_data[4];
  // column address set
  tftSendCommand(0x2A); // CASET
  pos_data[0] = (x0 >> 8) & 0xFF;
  pos_data[1] = x0 & 0xFF;
  pos_data[2] = (x1 >> 8) & 0xFF;
  pos_data[3] = x1 & 0xFF;
  tftWriteData((unsigned char *)&pos_data, 4);
  // row address set
  tftSendCommand(0x2B); // RASET
  pos_data[0] = (y0 >> 8) & 0xFF;
  pos_data[1] = y0 & 0xFF;
  pos_data[2] = (y1 >> 8) & 0xFF;
  pos_data[3] = y1 & 0xFF;
  tftWriteData((unsigned char *)&pos_data, 4);
  // write to RAM
  tftSendCommand(0x2C); // RAMWR
}

void tftFillRect(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, unsigned short color) {
  if ((x1 >= tftWIDTH) || (y1 >= tftHEIGHT) || (x2 >= tftWIDTH) || (y2 >= tftHEIGHT)) return;
  if (x1 > x2) swap(x1, x2);
  if (y1 > y2) swap(y1, y2);
  unsigned long drawPixels = (unsigned long)((unsigned long)(x2 - x1 + 1) * (unsigned long)(y2 - y1 + 1));
  tftSetAddrWindow(x1, y1, x2, y2);
  tftSetPinDC(1);
  tftSetPinCS(0); // говорим slave устройству что начинаем работать
  union {
    uint16_t val;
    struct {
      uint8_t lsb;
      uint8_t msb;
    };
  } in;
  in.val = color;
  while (drawPixels--) {
    SPDR = in.msb;
    asm volatile("nop"); // See transfer(uint8_t) function
    while (!(SPSR & _BV(SPIF))) ;
    SPDR = in.lsb;
    asm volatile("nop");
    while (!(SPSR & _BV(SPIF))) ;
  }
  tftSetPinCS(1); // end transfer
}

void tftInit(unsigned short w_size, unsigned short h_size, enum TFT9341_ROTATE_t locTFT9341_ROTATE) {
  pinMode(11, OUTPUT);
  pinMode(13, OUTPUT);
  digitalWrite(11, HIGH);
  digitalWrite(13, HIGH);
  pinMode(tft_cs_pin, OUTPUT);
  tftSetPinCS(1); // no transfer
  pinMode(tft_dc_pin, OUTPUT);
  SPI.begin();
  SPI.setBitOrder(MSBFIRST);                             //  MSB to be sent first
  SPI.setDataMode(SPI_MODE0);                      //  Set for clock rising edge
  SPI.setClockDivider(SPI_CLOCK_DIV2);
  // ---
  unsigned char _locDataSend[16];
  tftSendCommand(0x01); //Software Reset
  delay(1000UL); // delay 1 sec //Software Reset
  //Power Control A
  _locDataSend[0] = 0x39;
  _locDataSend[1] = 0x2C;
  _locDataSend[2] = 0x00;
  _locDataSend[3] = 0x34;
  _locDataSend[4] = 0x02;
  tftSendCommand(0xCB);
  tftWriteData((unsigned char *)_locDataSend, 5);
  //Power Control B
  _locDataSend[0] = 0x00;
  _locDataSend[1] = 0xC1;
  _locDataSend[2] = 0x30;
  tftSendCommand(0xCF);
  tftWriteData(_locDataSend, 3);
  //Driver timing control A
  _locDataSend[0] = 0x85;
  _locDataSend[1] = 0x00;
  _locDataSend[2] = 0x78;
  tftSendCommand(0xE8);
  tftWriteData(_locDataSend, 3);
  //Driver timing control B
  _locDataSend[0] = 0x00;
  _locDataSend[1] = 0x00;
  tftSendCommand(0xEA);
  tftWriteData(_locDataSend, 2);
  //Power on Sequence control
  _locDataSend[0] = 0x64;
  _locDataSend[1] = 0x03;
  _locDataSend[2] = 0x12;
  _locDataSend[3] = 0x81;
  tftSendCommand(0xED);
  tftWriteData(_locDataSend, 4);
  //Pump ratio control
  _locDataSend[0] = 0x20;
  tftSendCommand(0xF7);
  tftWriteData(_locDataSend, 1);
  //Power Control,VRH[5:0]
  _locDataSend[0] = 0x10;
  tftSendCommand(0xC0);
  tftWriteData(_locDataSend, 1);
  //Power Control,SAP[2:0];BT[3:0]
  _locDataSend[0] = 0x10;
  tftSendCommand(0xC1);
  tftWriteData(_locDataSend, 1);
  //VCOM Control 1
  _locDataSend[0] = 0x3E;
  _locDataSend[1] = 0x28;
  tftSendCommand(0xC5);
  tftWriteData(_locDataSend, 2);
  //VCOM Control 2
  _locDataSend[0] = 0x86;
  tftSendCommand(0xC7);
  tftWriteData(_locDataSend, 1);
  //Memory Acsess Control
  switch (locTFT9341_ROTATE) {
    case ROTATE_0: {
        _locDataSend[0] = 0x58;
        break;
      }
    case ROTATE_90: {
        _locDataSend[0] = 0x28;
        break;
      }
    case ROTATE_180: {
        _locDataSend[0] = 0x88;
        break;
      }
    case ROTATE_270: {
        _locDataSend[0] = 0xE8;
        break;
      }
  }
  //_locDataSend[0] = 0x48;
  tftSendCommand(0x36);
  tftWriteData(_locDataSend, 1);
  //Pixel Format Set
  _locDataSend[0] = 0x55;//16bit
  tftSendCommand(0x3A);
  tftWriteData(_locDataSend, 1);
  //Frame Rratio Control, Standard RGB Color
  _locDataSend[0] = 0x00;
  _locDataSend[1] = 0x18;
  tftSendCommand(0xB1);
  tftWriteData(_locDataSend, 2);
  //Display Function Control
  _locDataSend[0] = 0x08;
  _locDataSend[1] = 0x82;
  _locDataSend[2] = 0x27;//320 строк
  tftSendCommand(0xB6);
  tftWriteData(_locDataSend, 3);
  //Enable 3G (пока не знаю что это за режим)
  _locDataSend[0] = 0x00;//не включаем
  tftSendCommand(0xF2);
  tftWriteData(_locDataSend, 1);
  //Gamma set
  _locDataSend[0] = 0x01;//Gamma Curve (G2.2) (Кривая цветовой гаммы)
  tftSendCommand(0x26);
  tftWriteData(_locDataSend, 1);
  //Positive Gamma  Correction
  _locDataSend[0] = 0x0F;
  _locDataSend[1] = 0x31;
  _locDataSend[2] = 0x2B;
  _locDataSend[3] = 0x0C;
  _locDataSend[4] = 0x0E;
  _locDataSend[5] = 0x08;
  _locDataSend[6] = 0x4E;
  _locDataSend[7] = 0xF1;
  _locDataSend[8] = 0x37;
  _locDataSend[9] = 0x07;
  _locDataSend[10] = 0x10;
  _locDataSend[11] = 0x03;
  _locDataSend[12] = 0x0E;
  _locDataSend[13] = 0x09;
  _locDataSend[14] = 0x00;
  tftSendCommand(0xE0);
  tftWriteData(_locDataSend, 15);
  //Negative Gamma  Correction
  _locDataSend[0] = 0x00;
  _locDataSend[1] = 0x0E;
  _locDataSend[2] = 0x14;
  _locDataSend[3] = 0x03;
  _locDataSend[4] = 0x11;
  _locDataSend[5] = 0x07;
  _locDataSend[6] = 0x31;
  _locDataSend[7] = 0xC1;
  _locDataSend[8] = 0x48;
  _locDataSend[9] = 0x08;
  _locDataSend[10] = 0x0F;
  _locDataSend[11] = 0x0C;
  _locDataSend[12] = 0x31;
  _locDataSend[13] = 0x36;
  _locDataSend[14] = 0x0F;
  tftSendCommand(0xE1);
  tftWriteData(_locDataSend, 15);
  tftSendCommand(0x11);//Выйдем из спящего режима
  delay(120UL); // delay 120 msec
  //Display ON
  _locDataSend[0] = TFT9341_ROTATION;
  tftSendCommand(0x29);
  tftWriteData(_locDataSend, 1);
  switch (locTFT9341_ROTATE) {
    case ROTATE_0: {
        tftWIDTH = w_size;
        tftHEIGHT = h_size;
        break;
      }
    case ROTATE_90: {
        tftWIDTH = h_size;
        tftHEIGHT = w_size;
        break;
      }
    case ROTATE_180: {
        tftWIDTH = w_size;
        tftHEIGHT = h_size;
        break;
      }
    case ROTATE_270: {
        tftWIDTH = h_size;
        tftHEIGHT = w_size;
        break;
      }
  }
}

void tftFillScreen(unsigned short color) {
  tftFillRect(0, 0, tftWIDTH - 1, tftHEIGHT - 1, color);
}

void tftDrawImagePGM(const unsigned char * sourceImage, const unsigned char * palitraSrc, const unsigned char bitsPerPixel,
    unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2) {
    if ((x1 >= tftWIDTH) || (y1 >= tftHEIGHT) || (x2 >= tftWIDTH) || (y2 >= tftHEIGHT)) return;
    if (x1 > x2) swap(x1, x2);
    if (y1 > y2) swap(y1, y2);
    unsigned long countSourceBytes = (unsigned long)((unsigned long)(x2-x1+1) * (unsigned long)(y2-y1+1) / (unsigned long)(8 / bitsPerPixel));
  unsigned char rgb565palitra[512]; // max 256 colors
  for (unsigned short i = 0; i < (pow(2, bitsPerPixel) * 2); ++i) {
    rgb565palitra[i] = pgm_read_byte_near(palitraSrc + i);
  }
  tftSetAddrWindow(x1, y1, x2, y2);
  tftSetPinDC(1);
  tftSetPinCS(0); // говорим slave устройству что начинаем работать
  unsigned char countColors = (8 / bitsPerPixel);
  unsigned short maskPos = pow(2, bitsPerPixel) - 1;
  unsigned char mPos = (unsigned char)maskPos;
  for (unsigned long idxSrcByte = 0; idxSrcByte < countSourceBytes; ++idxSrcByte) {
    unsigned char oneSrcByte = pgm_read_byte_near(sourceImage + idxSrcByte);
    for (unsigned char iC = 0; iC < countColors; ++iC) {
        unsigned char posColor = oneSrcByte >> ((countColors - 1 - iC) * bitsPerPixel);
        posColor &= mPos;
        SPDR = rgb565palitra[posColor * 2];
        asm volatile("nop"); // See transfer(uint8_t) function
        while (!(SPSR & _BV(SPIF)));
        SPDR = rgb565palitra[posColor * 2 + 1];
        asm volatile("nop"); // See transfer(uint8_t) function
        while (!(SPSR & _BV(SPIF)));
    }
  }
  tftSetPinCS(1); // end transfer
}

void tftDrawPixel(unsigned short x, unsigned short y, unsigned short color) {
    tftSetAddrWindow(x, y, x, y);
    tftSetPinDC(1);
    tftSetPinCS(0); // говорим slave устройству что начинаем работать
    union {
        uint16_t val;
        struct {
            uint8_t lsb;
            uint8_t msb;
        };
    } in;
    in.val = color;
    SPDR = in.msb;
    asm volatile("nop"); // See transfer(uint8_t) function
    while (!(SPSR & _BV(SPIF)));
    SPDR = in.lsb;
    asm volatile("nop");
    while (!(SPSR & _BV(SPIF)));
    tftSetPinCS(1); // end transfer
}

void tftDrawLine(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, unsigned short color) {
    if ((y1 == y2) || (x1 == x2)) {
        tftFillRect(x1, y1, x2, y2, color);
    } else {
        if ((x1 >= tftWIDTH) || (y1 >= tftHEIGHT) || (x2 >= tftWIDTH) || (y2 >= tftHEIGHT)) return;
        signed short A = (signed short)y2 - (signed short)y1;
        signed short B = (signed short)x1 - (signed short)x2;
        signed short sign, signa, signb;
        if (abs(A) > abs(B)) sign = 1; else sign = -1;
        if (A < 0) signa = -1; else signa = 1;
        if (B < 0) signb = -1; else signb = 1;
        signed short f = 0;
        signed short x = x1;
        signed short y = y1;
        tftDrawPixel(x, y, color);
        if (sign == -1) {
            do {
                f += A * signa;
                if (f > 0)
                {
                    f -= B * signb;
                    y += signa;
                }
                x -= signb;
                tftDrawPixel(x, y, color);
            } while (x != x2 || y != y2);
        } else {
            do {
                f += B * signb;
                if (f > 0) {
                    f -= A * signa;
                    x -= signb;
                }
                y += signa;
                tftDrawPixel(x, y, color);
            } while (x != x2 || y != y2);
        }
    }
}

void tftDrawRect(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, unsigned short color) {
    tftDrawLine(x1, y1, x2, y1, color);
    tftDrawLine(x2, y1, x2, y2, color);
    tftDrawLine(x1, y1, x1, y2, color);
    tftDrawLine(x1, y2, x2, y2, color);
}

void Pixel_circle(signed short xc, signed short yc, signed short x, signed short y, unsigned short pixel) {
    tftDrawPixel(xc + x, yc + y, pixel);
    tftDrawPixel(xc + y, yc + x, pixel);
    tftDrawPixel(xc + y, yc - x, pixel);
    tftDrawPixel(xc + x, yc - y, pixel);
    tftDrawPixel(xc - x, yc - y, pixel);
    tftDrawPixel(xc - y, yc - x, pixel);
    tftDrawPixel(xc - y, yc + x, pixel);
    tftDrawPixel(xc - x, yc + y, pixel);
}

/*--------------------------------------------------- V_BRcirc
 * Генерирует 1/8 окружности по алгоритму Брезенхема
 *
 * Процедура может строить 1/4 окружности.
 * Для этого надо цикл while заменить на for (;;)
 * и после Pixel_circle проверять достижение конца по условию
 * if (y <= end) break;
 * Где end устанавливается равным 0
 * В этом случае не нужен и последний оператор
 * if (x == y) Pixel_circle (xc, yc, x, y, pixel);
 * Генерацию 1/8 можно обеспечить задав end = r / sqrt (2)
 */

void tftDrawCirc(unsigned short xc, unsigned short yc, unsigned short r, unsigned short pixel) {
    if ((xc < r) || (yc < r) || ((xc + r) >= tftWIDTH) || ((yc + r) >= tftHEIGHT)) return;
    signed short  x=0, y=r, z, Dd = 2* (1 - r);
    while (x < y) {
        Pixel_circle(xc, yc, x, y, pixel);
        if (!Dd) goto Pd;
        z = 2 * Dd - 1;
        if (Dd > 0) {
            if (z + 2 * x <= 0) goto Pd; else goto Pv;
        }
        if (z + 2 * y > 0) goto Pd;
    Pg:   ++x;      Dd = Dd + 2 * x + 1;   continue; /* Горизонт */
    Pd:   ++x; --y; Dd = Dd + 2 * (x - y + 1); continue; /* Диагонал */
    Pv:   --y;      Dd = Dd - 2 * y + 1;             /* Вертикал */
    }
    if (x == y) Pixel_circle(xc, yc, x, y, pixel);
}

void tftDrawTria(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, unsigned short x3, unsigned short y3, unsigned short color) {
    tftDrawLine(x1, y1, x2, y2, color);
    tftDrawLine(x2, y2, x3, y3, color);
    tftDrawLine(x1, y1, x3, y3, color);
}

void tftDrawChar(unsigned short x, unsigned short y, unsigned char inChar, unsigned short color, unsigned short bgcol) {
    tftSetAddrWindow(x, y, x + 7, y + 7);
    tftSetPinDC(1);
    tftSetPinCS(0); // говорим slave устройству что начинаем работать
    union {
        uint16_t val;
        struct {
            uint8_t lsb;
            uint8_t msb;
        };
    } in;
    for (unsigned char lC = 0; lC < 8; ++lC) { // line char
        unsigned char inLine = pgm_read_byte_near(frus08x08 + inChar*8 + lC);
        for (unsigned char bL = 8; bL > 0; --bL) { // bit line
            if (bitRead(inLine, bL-1)) in.val = color; else in.val = bgcol;
            SPDR = in.msb;
            asm volatile("nop"); // See transfer(uint8_t) function
            while (!(SPSR & _BV(SPIF)));
            SPDR = in.lsb;
            asm volatile("nop");
            while (!(SPSR & _BV(SPIF)));
        }
    }
    tftSetPinCS(1); // end transfer
}

void tftPrintStr(unsigned short x, unsigned short y, unsigned char * inString, unsigned short color, unsigned short bgcol) {
    unsigned char i = 0;
    while (inString[i++]) tftDrawChar(x+(i-1)*8, y, inString[i-1],color,bgcol);
}

void tftPrintRusUTF8(unsigned short x, unsigned short y, unsigned char* inString, unsigned short color, unsigned short bgcol) {
    unsigned char i = 0;
    unsigned short charPos = 0;
    while (inString[i]) {
        if (inString[i] == 0xD0) { // UTF символ
            if (inString[i+1] == 0x81) { // буква Ё
                tftDrawChar(x + charPos * 8, y, 0xA8, color, bgcol); // кладем символ
                ++i;
                ++charPos;
            } else if ((inString[i + 1] >= 0x90) && (inString[i + 1] <= 0xBF)) { // первая часть русской UTF
                tftDrawChar(x + charPos * 8, y, 0xC0 + (inString[i + 1] - 0x90), color, bgcol); // кладем символ
                ++i;
                ++charPos;
            } else { // или конец строки или байт не относиться к русской UTF
                tftDrawChar(x + charPos * 8, y, inString[i], color, bgcol); // кладем байт как есть
                ++charPos;
            }
        } else if (inString[i] == 0xD1) { // UTF символ
            if (inString[i + 1] == 0x91) { // буква ё
                tftDrawChar(x + charPos * 8, y, 0xB8, color, bgcol); // кладем символ
                ++i;
                ++charPos;
            } else if ((inString[i + 1] >= 0x80) && (inString[i + 1] <= 0x8F)) { // вторая часть русской UTF
                tftDrawChar(x + charPos * 8, y, 0xF0 + (inString[i + 1] - 0x80), color, bgcol); // кладем символ
                ++i;
                ++charPos;
            } else { // или конец строки или байт не относиться к русской UTF
                tftDrawChar(x + charPos * 8, y, inString[i], color, bgcol); // кладем байт как есть
                ++charPos;
            }
        } else {
            tftDrawChar(x + charPos * 8, y, inString[i], color, bgcol); // кладем байт как есть
            ++charPos;
        }
        ++i;
    }
}


 

lilik
Offline
Зарегистрирован: 19.10.2017

andycat пишет:

добавил рисование графических примитивов и текста


:)

Теперь мне осталось только дисплей такой купить.

Сделал игрушку с уже 3 подвижными картинками, тоже работает хорошо.

 

lilik
Offline
Зарегистрирован: 19.10.2017

andycat
andycat аватар
Offline
Зарегистрирован: 07.09.2017

lilik, все выше приведённые функции должны работать на вашем дисплее, они тупо 16 битный цвет пинают в spi.
ЗЫ. Я думал вы давно уж попробовали....
Ленитесь :)

lilik
Offline
Зарегистрирован: 19.10.2017

Да, подвис, хочу для себя сформировать общие правила и подходы при создания игрушек на st7735 и уно.

andycat
andycat аватар
Offline
Зарегистрирован: 07.09.2017

lilik пишет:

общие правила и подходы 

универсальных решений не бывает к сожалению, все зависит от каждой конкретной задачи.

lilik
Offline
Зарегистрирован: 19.10.2017

Ну и частные, двигать картинку по картинке, а не по фону.

Вот такой подход аппаратно не реализуем, да и по видео он явно избыточен.

https://arduino.ru/forum/proekty/avrkanoid

andriano
andriano аватар
Offline
Зарегистрирован: 20.06.2015

lilik пишет:

Да, подвис, хочу для себя сформировать общие правила и подходы при создания игрушек на st7735 и уно.

Эти два требования взаимно противоречивы.

Общее правило таково: размер оперативной памяти должен существенно превосходить размер видеопамяти.

Очевидно, для пары st7735 и Uno это общее правило не выполняется.

lilik
Offline
Зарегистрирован: 19.10.2017

lilik пишет:

Ну и частные, двигать картинку по картинке, а не по фону.

Вот такой подход аппаратно не реализуем, да и по видео он явно избыточен.

https://arduino.ru/forum/proekty/avrkanoid

Призрак рыцаря.

andycat
andycat аватар
Offline
Зарегистрирован: 07.09.2017

Цветов маловато в движущейся фигурке, не очень красиво по сравнению с фоновой картинкой, и смысл прозрачных внутренностей не понимаю.
Смысл спрайта чтоб движущаяся фигурка двигалась не в квадратике а аккуратно по фону, т е достаточно прозрачным делать наружную часть картинки.
Ну и кроме подвижных ног было бы не плохо поворачивать лицо в сторону движения.

lilik
Offline
Зарегистрирован: 19.10.2017

andycat пишет:
Цветов маловато в движущейся фигурке, не очень красиво по сравнению с фоновой картинкой, и смысл прозрачных внутренностей не понимаю. Смысл спрайта чтоб движущаяся фигурка двигалась не в квадратике а аккуратно по фону, т е достаточно прозрачным делать наружную часть картинки. Ну и кроме подвижных ног было бы не плохо поворачивать лицо в сторону движения.

Цветов четыре, один это прозрачный, поэтому остаётся три. Прозрачные внутренности, как и вся демонстрация не более чем проверка способа одновременного вывода данных из разных массивов-картинок. Скорости отрисовки хватит чтоб рисовать и движение ног и разворот фигурки или лица от края. В общем можно разрабатывать игры на фоновых картинках, но уже не очень интересно.   

ua6em
ua6em аватар
Offline
Зарегистрирован: 17.08.2016

ВНИМАНИЕ! Заказал дисплеи 1.7" и 1.8" получил, распиновка между ними не совпадает!!!

andycat
andycat аватар
Offline
Зарегистрирован: 07.09.2017

ua6em пишет:

распиновка между ними не совпадает!!!

а должны? дисплеи же разные.

Да и какая разница какая распиновка.

Argus19
Offline
Зарегистрирован: 08.05.2022

ua6em пишет:

ВНИМАНИЕ! Заказал дисплеи 1.7" и 1.8" получил, распиновка между ними не совпадает!!!

Типа, так:

andriano
andriano аватар
Offline
Зарегистрирован: 20.06.2015

ua6em пишет:

ВНИМАНИЕ! Заказал дисплеи 1.7" и 1.8" получил, распиновка между ними не совпадает!!!

Это что...

Я, помнится, купил 1306 (это OLED 128x64), он i2c - это 4 контакта. 

Потом купил, как я думал, такой же. Решил проверить на схеме, собранной для первого.

Оказалось, в распиновке земля и питание - наоборот.

Причем, кроме распиновки они ничем больше не различались.

Argus19
Offline
Зарегистрирован: 08.05.2022

 Пришёл 1,8" TFT. Вывод LCD, судя по всему надо подключить к +3,3V. Нужен ли токоограничивающий резистор?

ua6em
ua6em аватар
Offline
Зарегистрирован: 17.08.2016

Argus19 пишет:

 Пришёл 1,8" TFT. Вывод LCD, судя по всему надо подключить к +3,3V. Нужен ли токоограничивающий резистор?

нет, но лично я предпочитаю подключать на пин с шимом

Argus19
Offline
Зарегистрирован: 08.05.2022

ua6em пишет:

нет, но лично я предпочитаю подключать на пин с шимом

 Пин LCD потребляет ток. Вы используете какую-либо схему между пинами ардуино и дисплея?

ua6em
ua6em аватар
Offline
Зарегистрирован: 17.08.2016

Argus19 пишет:

ua6em пишет:

нет, но лично я предпочитаю подключать на пин с шимом

 Пин LCD потребляет ток. Вы используете какую-либо схему между пинами ардуино и дисплея?

нет, напрямую с пина, ток не измерял, но для светодиода 10ма хватит, а нагрузочная способность пина до 30ма

Argus19
Offline
Зарегистрирован: 08.05.2022

ua6em пишет:

нет, напрямую с пина, ток не измерял, но для светодиода 10ма хватит, а нагрузочная способность пина до 30ма

 Ясно.

Как-то не очень нагружать пины.... Если, кроме дисплея больше ничего, тогда может, и нормально.

lilik
Offline
Зарегистрирован: 19.10.2017

На моём дисплее подсветка берёт 28-29 мА.

andriano
andriano аватар
Offline
Зарегистрирован: 20.06.2015

ua6em пишет:

нет, напрямую с пина, ток не измерял, но для светодиода 10ма хватит, а нагрузочная способность пина до 30ма

Вообще-то для подсветки, как правило, используются светодиоды помощнее. Там до 200 мА может быть.

ua6em
ua6em аватар
Offline
Зарегистрирован: 17.08.2016

andriano пишет:

Там до 200 мА может быть.

вот чем хороша RP2040 ограничение тока на пине можно задать программно (и задается по умолчанию)
надо бы табличку составить  по токам подсветки для разных дисплеев, а то так и выжечь пин недолго

Argus19
Offline
Зарегистрирован: 08.05.2022

ua6em пишет:

вот чем хороша RP2040 ограничение тока на пине можно задать программно (и задается по умолчанию)
надо бы табличку составить  по токам подсветки для разных дисплеев, а то так и выжечь пин недолго

 Проще поставить эмиттерный повторитель.

ua6em
ua6em аватар
Offline
Зарегистрирован: 17.08.2016

Argus19 пишет:

ua6em пишет:

вот чем хороша RP2040 ограничение тока на пине можно задать программно (и задается по умолчанию)
надо бы табличку составить  по токам подсветки для разных дисплеев, а то так и выжечь пин недолго

 Проще поставить эмиттерный повторитель.

если выходного тока хватает, то не стоит, будем иметь уменьшение надёжности системы

lilik
Offline
Зарегистрирован: 19.10.2017

ua6em пишет:

...надо бы табличку составить  по токам подсветки для разных дисплеев, а то так и выжечь пин недолго

28-29 мА ток подсветки при напряжении 3,3В.

andriano
andriano аватар
Offline
Зарегистрирован: 20.06.2015

lilik пишет:

28-29 мА ток подсветки при напряжении 3,3В.

Во-первых, неплохо бы опубликовать методику и схему измерения.

А во-вторых, провести измерения также в диапазоне хотя бы от 2.97 В до 3.63 В.

lilik
Offline
Зарегистрирован: 19.10.2017

Измерял китайским мультиметром ток потребления дисплея с подсветкой и без. Потом составлял разность. Сейчас экранчик забросил пока до новых идей.

ua6em
ua6em аватар
Offline
Зарегистрирован: 17.08.2016

lilik пишет:

ua6em пишет:

...надо бы табличку составить  по токам подсветки для разных дисплеев, а то так и выжечь пин недолго

28-29 мА ток подсветки при напряжении 3,3В.

получил пару таких пару красных 1.8 с SD, в красных подсветка поярче, запитываю или от пина или от 3.3 вольта, РАСПИНОВКА ДИСПЛЕЕВ НЕ СОВПАДАЕТ МЕЖДУ СОБОЙ