Как очистить lcd дисплей arduino

от admin

Работа с символьными ЖК дисплеями 1602,2004.

Для работы с символьными графическими дисплеями предлагаем воспользоваться библиотекой LiquidCrystal которая входит в стандартный набор Arduino IDE и предназначена для работы по 8-битному (4-битному) параллельному интерфейсу. Если Ваш дисплей подключается к Arduino по аппаратной шине I2, то Вам нужно установить библиотеку LiquidCrystal_I2C (большинство функций которой повторяют функции первой библиотеки).

Поддерживаемые дисплеи:

Дисплей Подключение и инициализация
LCD1602 — символьный дисплей (16×02 символов),
с параллельным интерфейсом (синий)
#include <LiquidCrystal.h>
LiquidCrystal lcd( 2 , 3 , 4 , 5 , 6 , 7 [ , 8 , 9 , 10 , 11 ] );
void setup()< lcd.begin( 16 , 2 ); >

// Пояснение:
LiquidCrystal ОБЪЕКТ ( RS , E , D4 , D5 , D6 , D7 );
void setup()

Подключение дисплея LCD1602 к Arduino

// Пояснение:
LiquidCrystal ОБЪЕКТ ( RS , E , D4 , D5 , D6 , D7 );
void setup()

Подключение дисплея LCD2004 к Arduino

#1 Пример

Выводим надпись на дисплей LCD1602 подключённый по шине I2C. Для работы с дисплеем LCD2004 нужно изменить 3 строку на LiquidCrystal_I2C lcd(0x27,20,4);

#2 Пример

Выводим надпись на дисплей LCD1602 подключённый по 4-битной параллельной шине. Для работы с дисплеем LCD2004 нужно изменить 5 строку на lcd.begin(20, 4);

#3 Пример

Выводим надпись «Русский язык» на дисплей LCD1602 подключённый по шине I2C:

#4 Пример

Выводим время прошедшее после старта на дисплей LCD1602 подключённый по шине I2C:

Библиотека LiquidCrystal

LCD

Выводить информацию удобно на экран. Очень популярным решением является текстовый жидкокристаллический экран, знакомый нам по древним звонилкам. Для опытов я использовал простой текстовый экран 16×2 от компании МЭЛТ.

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

Краткое описание дисплея: LCD-дисплей MT-16S2H компании Мэлт служит для вывода текста с подсветкой. По изображению похож на дисплеи старых мобильных телефонов вроде Nokia 3310 или Siemens C35. Экран имеет 16 контактов для подведения питания и взаимодействия с управляющей электроникой. Для управления выводом дисплея возможно использовать только 6 из них. Дисплей выполнен на чипе, совместимом с HD44780, который является де-факто стандартом для LCD-экранов.

Процесс подключения очень хорошо описан на сайте Амперки — Подключение текстового экрана к Arduino

Основная особенность дисплея — необычная нумерация выходов. Всего их 16, но идут они не по порядку, а весьма нетривиальным способом. И только три из них подписаны: 14, 1 и 16. Но, оказывается, это вполне достаточно. Я помогу вам разобраться.

14 13 12 11 10 9 8 7 6 5 4 3 2 1 16 15
Контакт Обозначение Назначение
1 Vss Заземление
2 Vdd Питание 5В
3 Vo Регулировка контрастности (потенциометр)
4 Rs Выбор режим (командный или отображения данных)
5 RW Чтение/Запись
6 En Готовность данных
7 D0 Линия передачи данных 0 (не используется)
8 D1 Линия передачи данных 1 (не используется)
9 D2 Линия передачи данных 2 (не используется)
10 D3 Линия передачи данных 3 (не используется)
11 D4 Линия передачи данных 4
12 D5 Линия передачи данных 5
13 D6 Линия передачи данных 6
14 D7 Линия передачи данных 7
15 A Анод подсветки
16 K Катод подсветки

Вкратце, чтобы самому не забыть. Втыкаем дисплей своими 16 ножками в макетную плату. Подводим к рельсам питания макетки питание +5 В и землю с Arduino.

Фоновая подсветка дисплея — это отдельный контур, не связанный с остальным. Включить её можно подав +5 В на 15-й контакт дисплея и подключив 16-й контакт к земле. Соединив эти два контакта с соответствующими рельсами, можно включить Arduino и увидеть, что дисплей засветился.

Далее необходимо подключить цепь, отвечающую за отображение символов. Для этого предназначены контакты 1, 2 и 3 на дисплее. Перед подключением отключите Arduino от питания.

Первый — это земля. Соедините его с рельсой земли.

Второй — питание. Соедините его с рельсой +5 В.

Третий — контрастность. Для получение максимально контрастного изображения соедините его с рельсой земли. Вы можете подать на этот контакт произвольное напряжение от 0 до 5 В, чем оно выше, тем тусклее будет изображение, но вместе с этим снизится энергопотребление. Для возможности плавной регулировки контрастности можете подать на этот контакт выходной сигнал потенциометра.

После подключения, если включить Arduino, вы можете увидеть прямоугольные знакоместа. В зависимости от комбинации цветов текста и подсветки они могут быть как яркими и хорошо заметными, так и едва заметными. Это нормально: в любом случае, текст будет смотреться отлично.

Подключение шины данных

Для коммуникации между Arduino и экраном необходимо использовать несколько линий взаимодействия:

2 или 3 для командования дисплеем

4 или 8 для передачи данных (кодов символов и команд)

Таким образом занятыми окажутся от 6-ти до 11-ти контактов от обоих устройств. Если вам не требуется считывать с дисплея, что подходит под большинство сценариев использования, для команд понадобится 2 линии.

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

Итак, для подключения дисплея достаточно использовать 6 линий, 6 контактов на Arduino. Рассмотрим именно этот сценарий. Как упоминалось, нам не за чем считывать с дисплея, мы будем в него только писать. Поэтому соединим 5-й контакт дисплея, который отвечает за выбор чтение/запись с рельсой земли. Это означает «всегда писать».

Затем, соединяем Arduino и экран нашими 6-ю линиями коммуникации. Какие именно контакты будут выбраны на Arduino не имеет значения: мы зададим их в программе, но для примера была выбрана такая конфигурация:

4-й контакт дисплея — 4-й контакт Arduino. Это линия адресного сигнала. Известная как A0 или RS. В зависимости от того, 0 она или 1, дисплей понимает имеем ли мы на линии данных команду вроде «передвинуть курсор» или код символа для отображения.

6-й контакт дисплея — 5-й контакт Arduino. Это линия разрешения доступа к данным. Известная, как E или Enable. Когда эта линия становится единицей, дисплей исполняет команду или выводит символ с линии данных.

11-й, 12-й, 13-й, 14-й контакт дисплея — 10-й, 11-й, 12-й, 13-й контакт Arduino соответственно. Это линии данных. Известные как D4, D5, D6, D7.

Программирование

Существует стандартная библиотека LiquidCrystal для работы с текстовыми жидкокристаллическими экранами.

В Arduino IDE выбираем меню Sketch | Import Library | LiquidCrystal. В начало скетча будет вставлена строка.

Это удобно, если вы позабыли правильное написание библиотеки и убережёт от опечаток.

Также в состав Arduino IDE входят несколько примеров работы с библиотекой: File | Examples | LiquidCrystal.

Единственное, что вам нужно сделать — это менять строчку инициализации контактов в соответствии с вашими соединениями.

А ещё лучше использовать константы.

Простейшая программа для вывода «Hello World»

В данном случае функция loop() нам не требуется, поэтому оставляем её пустой.

Нужно помнить, что фуккция print() не проверяет длину строк, поэтому самостоятельно следите за своими данными.

Рассмотрим поставляемые примеры.

Autoscroll

Бегущая строка. Выводится первая строка, затем вторая.

Blink

Выводим строку hello, world! и мигающий курсор в виде знакоместа.

Cursor

Выводим строку hello, world! и мигающий символ в виде значка подчёркивания.

CustomCharacter

Выводим собственные символы: сердечко, смайлик. Небольшая анимация человечка.

Display

Выводим мигающий текст.

HelloWorld

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

Scroll

Выводим бегущую строку, которая движется вправо и влево.

SerialDisplay

Вводим текст в Serial Monitor, чтобы увидеть его на дисплее.

SetCursor

Выводим символы алфавита во все доступные позиции экрана.

TextDirection

Выводим символы в разных направлениях, используя функции leftToRight() и rightToLeft().

Индикатор прогресса яркости светодиода

Создадим проект, в котором будем получать данные с потенциометра и выводить получаемые данные на экран в виде индикатора прогресса. Также будем менять яркость светодиода в соответствии с показаниями. Так как показания варьируются от 0 до 1024, необходимо преобразовать значения в пределах от 0 до 256 для светодиода и от 0 до 17 для экрана. Сам индикатор состоит из полностью закрашенного прямоугольника. Если выводить подобные прямоугольники с начала строки, то будет похоже на индикатор прогресса.

Потенциометр подключаем к выводу A0, светодиод к выводу 6. Подключение ЖК-дисплея стандартное, как описано в начале статьи.

Progressbar

Кириллица

Не все дисплеи имеют кириллицу. Дисплей от Мэлт поддерживает русский язык. Но просто напечатать текст на русском не получится. Так например, букве «Я» соответствует код B1 в шестнадцатиричной системе. Чтобы передать на экран строку «Яndex», необходимо в явном виде с помощью последовательности \x## встроить в строку код символа:

Можете смешивать в одной строке обычные символы и явные коды как угодно. Единственный нюанс в том, что после того, как компилятор в строке видит последовательность \x, он считывает за ним все символы, которые могут являться разрядами шестнадцатиричной системы даже если их больше двух. Из-за этого вы не можете просто использовать символы из диапазона 0-9, a-f следом за двузначным кодом символа: это вызовет ошибку компиляции. Чтобы обойти этот момент, можно использовать тот факт, что две строки записанные рядом склеиваются. Так, если вы хотите написать «Яeee»:

Полную таблицу символов с кодами можно найти в документации к экрану.

Я на скорую руку написал скрипт на JavaScript, который конвертирует слова в нижнем регистре в нужные последовательности. Если в слове встречаются повторяющие буквы, то нажмите на кнопку несколько раз.

Библиотека LiquidCrystalRus с поддержкой кириллицы

Совсем не обязательно мучиться с байтами, чтобы вывести русский символ. Существует библиотека LiquidCrystalRus, которая поддерживает кириллицу. Исходники лежат на Гитхабе. Скачайте файл LiquidCrystalRus-1.6.0.zip и распакуйте его в папку libraries. У вас получится что-то типа D:\Arduino\libraries\LiquidCrystalRus. В папке находятся файлы библиотеки и папка examples, содержащая три скетча. После этого примеры будут доступны из Arduino IDE. Запустите пример File | Examples | LiquidCrystalRus | HelloWorldRus и убедитесь, что экран способен выводить русские символы.

Функции библиотеки LiquidCrystal

autoscroll()

Функция autoscroll() включает автоматическую прокрутку экрана жидкокристаллического индикатора и заставляет каждый вывод символа на экран индикатора перемещать предыдущие символы на одно знакоместо. Если текущее направление вывода символов слева направо (значение по умолчанию) — экран индикатора прокручивается влево; если текущее направление вывода символов справа налево — экран индикатора прокручивается вправо. Это производит эффект вывода каждого нового символа в одно и то же знакоместо на экране жидкокристаллического индикатора.

  • lcd — переменная типа LiquidCrystal

begin()

Функция begin() определяет размерность (количество символов в ширину и высоту) индикатора.

  • lcd — переменная типа LiquidCrystal
  • cols — количество символов в строке
  • rows — количество строк

blink()

Функция blink() выводит на экран жидкокристаллического индикатора мигающий курсор. Если она используется в комбинации с функцией cursor(), результат будет зависеть от конкретного индикатора.

  • lcd — переменная типа LiquidCrystal

clear()

Функция clear() очищает экран жидкокристаллического индикатора и располагает курсор в верхнем левом углу.

  • lcd — переменная типа LiquidCrystal

createChar()

Функция createChar() создаёт пользовательский символ (глиф) для использования на жидкокристаллическом дисплее. Поддерживаются до восьми символов 5×8 пикселов (нумерация с 0 до 7). Создание каждого пользовательского символа определяется массивом из восьми байтов — один байт для каждой строки. Пять младших значащих битов каждого байта определяют пикселы в этой строке. Чтобы вывести пользовательский символ на экран, используйте функцию write() с номером символа в качестве параметра.

  • lcd — переменная типа LiquidCrystal
  • num — номер создаваемого символа (0 to 7)
  • data — данные символьных пикселов

cursor()

Функция cursor() выводит на экран жидкокристаллического индикатора курсор — подчёркивание знакоместа в позиции, в которую будет записан следующий символ.

  • lcd — переменная типа LiquidCrystal

display()

Функция display() включает жидкокристаллический индикатор после того, как он был выключен функцией noDisplay(). Эта функция восстанавливает текст (и курсор), который был на дисплее.

  • lcd — переменная типа LiquidCrystal

Функция home() располагает курсор в верхнем левом углу жидкокристаллического индикатора. Используется для определения начального положения при выводе последовательного текста на экран индикатора. Чтобы ещё и очистить экран индикатора, используйте вместо этой функции функцию clear().

  • lcd — переменная типа LiquidCrystal

leftToRight()

Функция leftToRight() устанавливает направление вывода символов на экран жидкокристаллического индикатора слева направо (значение по умолчанию). Это означает, что последующие символы, выводимые на экран индикатора, пойдут слева направо, но не повлияют на выведенный ранее текст.

  • lcd — переменная типа LiquidCrystal

LiquidCrystal()

Конструктор LiquidCrystal() создаёт переменную типа LiquidCrystal. Индикатором можно управлять, используя 4 или 8 линий данных. Для подключения по 4-м линиям пропустите контакты от D0 до D3 и оставьте эти линии неподключёнными. Контакт RW может быть соединён с «землёй» вместо соединения с контактом платы Arduino. Если в вашей схеме так — пропустите этот параметр функции.

  • rs — номер контакта платы Arduino, который соединяется с контактом RS жидкокристаллического индикатора
  • rw — номер контакта платы Arduino, который соединяется с контактом RW жидкокристаллического индикатора (опционально)
  • enable — номер контакта платы Arduino, который соединяется с контактом ENABLE жидкокристаллического индикатора
  • d0, d1, d2, d3, d4, d5, d6, d7 — номера контактов платы Arduino, которые соединяются соответственно с контактами данных жидкокристаллического инди-катора. D0, D1, D2 И D3 опциональны — если они не задействованы, жидкокристаллический индикатор будет управляться только через 4 линии данных (D4, D5, D6, D7)

noAutoscroll()

Функция noAutoscroll() выключает автоматическую прокрутку экрана жидкокристаллического индикатора.

  • lcd — переменная типа LiquidCrystal

noBlink()

Функция noBlink() выключает мигающий курсор на экране жидкокристаллического индикатора.

  • lcd — переменная типа LiquidCrystal

noCursor()

Функция noCursor() скрывает курсор с экрана жидкокристаллического индикатора.

  • lcd — переменная типа LiquidCrystal

noDisplay()

Функция noDisplay() выключает жидкокристаллический индикатор без потери отображаемой на нем информации.

  • lcd — переменная типа LiquidCrystal

print()

Функция print() печатает текст на жидкокристаллическом индикаторе.

  • lcd — переменная типа LiquidCrystal
  • data — данные для печати (тип char, byte, int, long или string)
  • BASE (опционально) — основание, по которому печатаются числа: BIN для двоичных (основание 2), DEC для десятичных (основание 10), OCT для восьмеричных (основание 8), HEX для шестнадцатеричных (основание 16)

rightToLeft()

Функция rightToLeft() устанавливает направление вывода символов на экран жидкокристаллического индикатора справа налево (значение по умолчанию — слева направо). Это означает, что последующие символы, выводимые на экран индикатора, пойдут справа налево, но не повлияют на выведенный ранее текст.

  • lcd — переменная типа LiquidCrystal

scrollDisplayLeft()

Функция scrollDisplayLeft() прокручивает информацию на экране индикатора (текст и курсор) на одно знакоместо влево.

  • lcd — переменная типа LiquidCrystal

scrollDisplayRight()

Функция scrollDisplayRight() прокручивает информацию на экране индикатора (текст и курсор) на одно знакоместо вправо.

  • lcd — переменная типа LiquidCrystal

setCursor()

Функция setCursor() позиционирует курсор жидкокристаллического индикатора, т.е. устанавливает положение, в котором на его экран будет выведен последующий текст.

  • lcd — переменная типа LiquidCrystal
  • col — номер знакоместа в ряду (начиная с 0 для первого знакоместа)
  • row — номер ряда (начиная с 0 для первого ряда)

write()

Функция write() записывает символ в жидкокристаллический индикатор.

  • lcd — переменная типа LiquidCrystal
  • data — символ, записываемый в индикатор

Собственные символы

Собственные символы рисуются с помощью функции createChar(). Пример, предлагаемый на сайте Arduino:

Вы можете нарисовать несколько собственных символов и вывести их на экран.

Визуальный редактор

Редактор для создания собственных символов для дисплеев HD44780

wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return. Omer Kilic —————————————————————————- —> Щёлкайте по квадратам для генерации кода.

Знакоместо

Результат

LCD Module Arduino Pin
RS
RW GND
Enable
D4
D5
D6
D7

Код для скетча Arduino

Экран с I2C

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

На других микроконтроллерах сигнальные выводы отличаются (Leonardo: SDA-D2, SCL-D3; MEGA, ADK, DUE: SDA-D20, SCL-D21).

Модуль может поставляться отдельно и его нужно припаять самостоятельно. Но проще сразу приобрести готовый собранный модуль с экраном. Встречаются различные модификации экранов — 4х20, 2х16.

I2C

Стандартная библиотека не подойдёт. Нужно использовать библиотеку с поддержкой I2C LiquidCrystal I2C by Frank de Brabander (GitHub).

После установки библиотеки будут доступны несколько примеров: CustomChars, HelloWorld, SerialDisplay.

Если при запуске примера не видны символы на экране, то попробуйте покрутить винт на модуле для изменения контрастности. У меня был именно такой случай.

Библиотека i2cdetect

В примерах важно использовать правильный адрес. Самый типичный пример — использовать адрес 0х27.

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

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

LiquidCrystal Library¶

This library allows an Arduino board to control LiquidCrystal displays (LCDs) based on the Hitachi HD44780 (or a compatible) chipset, which is found on most text-based LCDs. The library works with in either 4- or 8-bit mode (i.e. using 4 or 8 data lines in addition to the rs, enable, and, optionally, the rw control lines).

Lcd_1602

Lcd display 1602

Functions¶

LiquidCrystal()¶

Description¶

Creates a variable of type LiquidCrystal. The display can be controlled using 4 or 8 data lines. If the former, omit the pin numbers for d0 to d3 and leave those lines unconnected. The RW pin can be tied to ground instead of connected to a pin on the Arduino; if so, omit it from this function’s parameters.

Syntax¶

Parameters¶

Example¶

begin()¶

Description¶

Initializes the interface to the LCD screen, and specifies the dimensions (width and height) of the display. begin() needs to be called before any other LCD library commands.

Syntax¶

Parameters¶

clear()¶

Description¶

Clears the LCD screen and positions the cursor in the upper-left corner.

Syntax¶

Parameters¶

Description¶

Positions the cursor in the upper-left of the LCD. That is, use that location in outputting subsequent text to the display. To also clear the display, use the clear() function instead.

Syntax¶

Parameters¶

setCursor()¶

Description¶

Position the LCD cursor; that is, set the location at which subsequent text written to the LCD will be displayed.

Syntax¶

Parameters¶

write()¶

Description¶

Write a character to the LCD.

Syntax¶

Parameters¶

Returns¶

write() will return the number of bytes written, though reading that number is optional

Example¶

print()¶

Description¶

Prints text to the LCD.

Syntax¶

Parameters¶

(optional): the base in which to print numbers:

  • BIN for binary (base 2),
  • DEC for decimal (base 10),
  • OCT for octal (base 8),
  • HEX for hexadecimal (base 16).

Returns¶

print() will return the number of bytes written, though reading that number is optional

Example¶

cursor()¶

Description¶

Display the LCD cursor: an underscore (line) at the position to which the next character will be written.

Syntax¶

Parameters¶

Example¶

See also¶

noCursor()¶

Description¶

Hides the LCD cursor.

Syntax¶

Parameters¶

Example¶

See also¶

blink()¶

Description¶

Display the blinking LCD cursor. If used in combination with the cursor() function, the result will depend on the particular display.

Syntax¶

Parameters¶

Example¶

See also¶

noBlink()¶

Description¶

Turns off the blinking LCD cursor.

Syntax¶

Parameters¶

Example¶

See also¶

display()¶

Description¶

Turns on the LCD display, after it’s been turned off with noDisplay(). This will restore the text (and cursor) that was on the display.

Syntax¶

Parameters¶

Example¶

See also¶

noDisplay()¶

Description¶

Turns off the LCD display, without losing the text currently shown on it.

Syntax¶

Parameters¶

Example¶

See also¶

scrollDisplayLeft()¶

Description¶

Scrolls the contents of the display (text and cursor) one space to the left.

Syntax¶

Parameters¶

Example¶

“scrollDisplayLeft() and scrollDisplayRight()”

See also¶

scrollDisplayRight()¶

Description¶

Scrolls the contents of the display (text and cursor) one space to the right.

Syntax¶

Parameters¶

Example¶

“scrollDisplayLeft() and scrollDisplayRight()”

See also¶

autoscroll()¶

Description¶

Turns on automatic scrolling of the LCD. This causes each character output to the display to push previous characters over by one space. If the current text direction is left-to-right (the default), the display scrolls to the left; if the current direction is right-to-left, the display scrolls to the right. This has the effect of outputting each new character to the same location on the LCD.

Syntax¶

Parameters¶

See also¶

noAutoscroll()¶

Description¶

Turns off automatic scrolling of the LCD.

Syntax¶

Parameters¶

See also¶

leftToRight()¶

Description¶

Set the direction for text written to the LCD to left-to-right, the default. This means that subsequent characters written to the display will go from left to right, but does not affect previously-output text.

Syntax¶

Parameters¶

See also¶

rightToLeft()¶

Description¶

Set the direction for text written to the LCD to right-to-left (the default is left-to-right). This means that subsequent characters written to the display will go from right to left, but does not affect previously-output text.

Syntax¶

Parameters¶

See also¶

createChar()¶

Description¶

Create a custom character (gylph) for use on the LCD. Up to eight characters of 5×8 pixels are supported (numbered 0 to 7). The appearance of each custom character is specified by an array of eight bytes, one for each row. The five least significant bits of each byte determine the pixels in that row. To display a custom character on the screen, write() its number. NB : When referencing custom character “0”, if it is not in a variable, you need to cast it as a byte, otherwise the compiler throws an error. See the example below.

Syntax¶

Parameters¶

Example¶

Examples¶

LiquidCrystal — “Hello World!”¶

The LiquidCrystal library allows you to control LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface.

This example sketch prints “Hello World!” to the LCD and shows the time in seconds since the Arduino was reset.

output of the sketch on a 2×16 LCD

The LCDs have a parallel interface, meaning that the microcontroller has to manipulate several interface pins at once to control the display. The interface consists of the following pins:

  • A register select (RS) pin that controls where in the LCD’s memory you’re writing data to. You can select either the data register, which holds what goes on the screen, or an instruction register, which is where the LCD’s controller looks for instructions on what to do next.
  • A Read/Write (R/W) pin that selects reading mode or writing mode
  • An Enable pin that enables writing to the registers 8 data pins (D0 -D7). The states of these pins (high or low) are the bits that you’re writing to a register when you write, or the values you’re reading when you read.
  • There’s also a display constrast pin (Vo),
  • power supply pins (+5V and Gnd) and
  • LED Backlight (Bklt+ and BKlt-) pins that you can use to power the LCD, control the display contrast, and turn on and off the LED backlight, respectively.

The process of controlling the display involves putting the data that form the image of what you want to display into the data registers, then putting instructions in the instruction register. The LiquidCrystal Library simplifies this for you so you don’t need to know the low-level instructions.

The Hitachi-compatible LCDs can be controlled in two modes: 4-bit or 8-bit. The 4-bit mode requires seven I/O pins from the Arduino, while the 8-bit mode requires 11 pins. For displaying text on the screen, you can do most everything in 4-bit mode, so example shows how to control a 2×16 LCD in 4-bit mode.

Hardware Required¶

  • Arduino Board
  • LCD Screen (compatible with Hitachi HD44780 driver)
  • pin headers to solder to the LCD display pins
  • 10k Potentiometer
  • breadboard
  • hook-up wire

Circuit¶

Before wiring the LCD screen to your Arduino we suggest to solder a pin header strip to the 14 (or 16) pin count connector of the LCD screen, as you can see in the image above.

Lcd connections

Lcd display connections

To wire your LCD screen to your Arduino, connect the following pins:

  • LCD RS pin to digital pin 12
  • LCD Enable pin to digital pin 11
  • LCD D4 pin to digital pin 5
  • LCD D5 pin to digital pin 4
  • LCD D6 pin to digital pin 3
  • LCD D7 pin to digital pin 2
  • Additionally, wire a 10K pot to +5V and GND, with it’s wiper (output) to LCD screens VO pin (pin3).

Lcd schem

Lcd display schem

(Image developed using Fritzing. For more circuit examples, see the Fritzing project page)

See Also¶

  • lcd.begin()
  • lcd.print()
  • lcd.setCursor()
  • Liquid Crystal Library
  • Blink: control of the block-style cursor.
  • Cursor: control of the underscore-style cursor.
  • Display: quickly blank the display without losing what’s on it.
  • TextDirection: control which way text flows from the cursor.
  • Scroll: scroll text left and right.
  • Serial input: accepts serial input, displays it.
  • SetCursor: set the cursor position.
  • Autoscroll: shift text right and left.

LiquidCrystal — blink() and noBlink()¶

The Liquid Crystal Library allows you to control LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface.

This example sketch shows how to use the blink() and noBlink() methods to blink a block-style cursor.

Hardware Required¶

  • Arduino Board
  • LCD Screen (compatible with Hitachi HD44780 driver)
  • pin headers to solder to the LCD display pins
  • 10k Potentiometer
  • breadboard
  • hook-up wire

Circuit¶

Before wiring the LCD screen to your Arduino we suggest to solder a pin header strip to the 14 (or 16) pin count connector of the LCD screen, as you can see in the image above.

Lcd connections

Lcd display connections

To wire your LCD screen to your Arduino, connect the following pins:

  • LCD RS pin to digital pin 12
  • LCD Enable pin to digital pin 11
  • LCD D4 pin to digital pin 5
  • LCD D5 pin to digital pin 4
  • LCD D6 pin to digital pin 3
  • LCD D7 pin to digital pin 2
  • Additionally, wire a 10K pot to +5V and GND, with it’s wiper (output) to LCD screens VO pin (pin3).

Lcd schem

Lcd display schem

(Image developed using Fritzing. For more circuit examples, see the Fritzing project page)

See Also¶

  • lcd.begin()
  • lcd.print()
  • lcd.Blink()
  • lcd.noBlink()
  • Liquid Crystal Library
  • Blink: control of the block-style cursor.
  • Cursor: control of the underscore-style cursor.
  • Display: quickly blank the display without losing what’s on it.
  • TextDirection: control which way text flows from the cursor.
  • Scroll: scroll text left and right.
  • Serial input: accepts serial input, displays it.
  • SetCursor: set the cursor position.
  • Autoscroll: shift text right and left.

LiquidCrystal — cursor() and noCursor()¶

The Liquid Crystal Library allows you to control LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface. This example sketch shows how to use the cursor() and noCursor() methods to control an underscore-style cursor. Hardware Required

Arduino Board LCD Screen (compatible with Hitachi HD44780 driver) pin headers to solder to the LCD display pins 10k Potentiometer breadboard hook-up wire Circuit

Before wiring the LCD screen to your Arduino we suggest to solder a pin header strip to the 14 (or 16) pin count connector of the LCD screen, as you can see in the image above. To wire your LCD screen to your Arduino, connect the following pins: LCD RS pin to digital pin 12 LCD Enable pin to digital pin 11 LCD D4 pin to digital pin 5 LCD D5 pin to digital pin 4 LCD D6 pin to digital pin 3 LCD D7 pin to digital pin 2 Additionally, wire a 10K pot to +5V and GND, with it’s wiper (output) to LCD screens VO pin (pin3). click the images to enlarge

image developed using Fritzing. For more circuit examples, see the Fritzing project page

Demonstrates the use a 16×2 LCD display. The LiquidCrystal library works with all LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface.

This sketch prints “Hello World!” to the LCD and uses the cursor() and noCursor() methods to turn on and off the cursor.

The circuit: * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 * LCD D4 pin to digital pin 5 * LCD D5 pin to digital pin 4 * LCD D6 pin to digital pin 3 * LCD D7 pin to digital pin 2 * LCD R/W pin to ground * 10K resistor: * ends to +5V and ground * wiper to LCD VO pin (pin 3)

Library originally added 18 Apr 2008 by David A. Mellis library modified 5 Jul 2009 by Limor Fried (http://www.ladyada.net) example added 9 Jul 2009 by Tom Igoe modified 22 Nov 2010 by Tom Igoe

This example code is in the public domain.

// include the library code: #include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// Turn off the cursor: lcd.noCursor(); delay(500);

> [Get Code] See Also:

lcd.begin() lcd.print() lcd.Cursor() lcd.NoCursor() Liquid Crystal Library Blink: control of the block-style cursor. Display: quickly blank the display without losing what’s on it. TextDirection: control which way text flows from the cursor. Scroll: scroll text left and right. Serial input: accepts serial input, displays it. SetCursor: set the cursor position. Autoscroll: shift text right and left.

LiquidCrystal — display() and noDisplay()¶

The Liquid Crystal Library allows you to control LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface. This example sketch shows how to use the display() and noDisplay() methods to turn on and off the display. The text to be displayed will still be preserved when you use noDisplay() so it’s a quick way to blank the display without losing everything on it. Hardware Required

Arduino Board LCD Screen (compatible with Hitachi HD44780 driver) pin headers to solder to the LCD display pins 10k Potentiometer breadboard hook-up wire Circuit

Before wiring the LCD screen to your Arduino we suggest to solder a pin header strip to the 14 (or 16) pin count connector of the LCD screen, as you can see in the image above. To wire your LCD screen to your Arduino, connect the following pins: LCD RS pin to digital pin 12 LCD Enable pin to digital pin 11 LCD D4 pin to digital pin 5 LCD D5 pin to digital pin 4 LCD D6 pin to digital pin 3 LCD D7 pin to digital pin 2 Additionally, wire a 10K pot to +5V and GND, with it’s wiper (output) to LCD screen’s VO pin (pin3). click the images to enlarge

image developed using Fritzing. For more circuit examples, see the Fritzing project page

Demonstrates the use a 16×2 LCD display. The LiquidCrystal library works with all LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface.

This sketch prints “Hello World!” to the LCD and uses the display() and noDisplay() functions to turn on and off the display.

The circuit: * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 * LCD D4 pin to digital pin 5 * LCD D5 pin to digital pin 4 * LCD D6 pin to digital pin 3 * LCD D7 pin to digital pin 2 * LCD R/W pin to ground * 10K resistor: * ends to +5V and ground * wiper to LCD VO pin (pin 3)

Library originally added 18 Apr 2008 by David A. Mellis library modified 5 Jul 2009 by Limor Fried (http://www.ladyada.net) example added 9 Jul 2009 by Tom Igoe modified 22 Nov 2010 by Tom Igoe

This example code is in the public domain.

// include the library code: #include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// Turn off the display: lcd.noDisplay(); delay(500);

> [Get Code] See Also:

lcd.begin() lcd.print() lcd.Display() lcd.NoDisplay() Liquid Crystal Library Blink: control of the block-style cursor. Cursor: control of the underscore-style cursor. TextDirection: control which way text flows from the cursor. Scroll: scroll text left and right. Serial input: accepts serial input, displays it. SetCursor: set the cursor position. Autoscroll: shift text right and left.

LiquidCrystal — Text Direction (leftToRight() and rightToLeft()¶

The Liquid Crystal Library allows you to control LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface. This example sketch shows how to use the leftToRight() and rightToLeft() methods. These methods control which way text flows from the cursor. rightToLeft() causes text to flow to the left from the cursor, as if the display is right-justified. leftToRight() causes text to flow to the right from the cursor, as if the display is left-justified. This sketch prints a through l right to left, then m through r left to right, then s through z right to left again. Hardware Required

Arduino Board LCD Screen (compatible with Hitachi HD44780 driver) pin headers to solder to the LCD display pins 10k Potentiometer breadboard hook-up wire Circuit

Before wiring the LCD screen to your Arduino we suggest to solder a pin header strip to the 14 (or 16) pin count connector of the LCD screen, as you can see in the image above. To wire your LCD screen to your Arduino, connect the following pins: LCD RS pin to digital pin 12 LCD Enable pin to digital pin 11 LCD D4 pin to digital pin 5 LCD D5 pin to digital pin 4 LCD D6 pin to digital pin 3 LCD D7 pin to digital pin 2 Additionally, wire a 10K pot to +5V and GND, with it’s wiper (output) to LCD screens VO pin (pin3). click the images to enlarge

image developed using Fritzing. For more circuit examples, see the Fritzing project page

Demonstrates the use a 16×2 LCD display. The LiquidCrystal library works with all LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface.

This sketch demonstrates how to use leftToRight() and rightToLeft() to move the cursor.

The circuit: * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 * LCD D4 pin to digital pin 5 * LCD D5 pin to digital pin 4 * LCD D6 pin to digital pin 3 * LCD D7 pin to digital pin 2 * LCD R/W pin to ground * 10K resistor: * ends to +5V and ground * wiper to LCD VO pin (pin 3)

Library originally added 18 Apr 2008 by David A. Mellis library modified 5 Jul 2009 by Limor Fried (http://www.ladyada.net) example added 9 Jul 2009 by Tom Igoe modified 22 Nov 2010 by Tom Igoe

This example code is in the public domain.

// include the library code: #include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

> // print the character lcd.write(thisChar); // wait a second: delay(1000); // increment the letter: thisChar++;

> [Get Code] See Also:

lcd.begin() lcd.print() lcd.rightToLeft() lcd.leftToRight() lcd.home() Liquid Crystal Library Blink: control of the block-style cursor. Cursor: control of the underscore-style cursor. Display: quickly blank the display without losing what’s on it. Scroll: scroll text left and right. Serial input: accepts serial input, displays it. SetCursor: set the cursor position. Autoscroll: shift text right and left.

LiquidCrystal — autoscroll()¶

The Liquid Crystal Library allows you to control LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface. This example sketch shows how to use the autoscroll() and noAutoscroll() methods to move all the text on the display left or right. autoscroll() moves all the text one space to the left each time a letter is added noAutoscroll() turns scrolling off This sketch prints the characters 0 to 9 with autoscroll off, then moves the cursor to the bottom right, turns autoscroll on, and prints them again. Hardware Required

Arduino Board LCD Screen (compatible with Hitachi HD44780 driver) pin headers to solder to the LCD display pins 10k Potentiometer breadboard hook-up wire Circuit

Before wiring the LCD screen to your Arduino we suggest to solder a pin header strip to the 14 (or 16) pin count connector of the LCD screen, as you can see in the image above. To wire your LCD screen to your Arduino, connect the following pins: LCD RS pin to digital pin 12 LCD Enable pin to digital pin 11 LCD D4 pin to digital pin 5 LCD D5 pin to digital pin 4 LCD D6 pin to digital pin 3 LCD D7 pin to digital pin 2 Additionally, wire a 10K pot to +5V and GND, with it’s wiper (output) to the LCD screen’s VO pin (pin3). click the images to enlarge

image developed using Fritzing. For more circuit examples, see the Fritzing project page

Demonstrates the use a 16×2 LCD display. The LiquidCrystal library works with all LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface.

This sketch demonstrates the use of the autoscroll() and noAutoscroll() functions to make new text scroll or not.

The circuit: * LCD RS pin to digital pin 12 * LCD Enable pin to digital pin 11 * LCD D4 pin to digital pin 5 * LCD D5 pin to digital pin 4 * LCD D6 pin to digital pin 3 * LCD D7 pin to digital pin 2 * LCD R/W pin to ground * 10K resistor: * ends to +5V and ground * wiper to LCD VO pin (pin 3)

Library originally added 18 Apr 2008 by David A. Mellis library modified 5 Jul 2009 by Limor Fried (http://www.ladyada.net) example added 9 Jul 2009 by Tom Igoe modified 22 Nov 2010 by Tom Igoe

This example code is in the public domain.

// include the library code: #include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// set the cursor to (0,0): lcd.setCursor(0, 0); // print from 0 to 9: for (int thisChar — 0; thisChar < 10; thisChar++) <

// set the cursor to (16,1): lcd.setCursor(16,1); // set the display to automatically scroll: lcd.autoscroll(); // print from 0 to 9: for (int thisChar — 0; thisChar < 10; thisChar++) <

> // turn off automatic scrolling lcd.noAutoscroll();

// clear screen for the next loop: lcd.clear();

> [Get Code] See Also:

lcd.begin() lcd.print() lcd.setCursor() lcd.autoscroll() lcd.noAutoscroll() lcd.clear() for() Blink: control of the block-style cursor. Cursor: control of the underscore-style cursor. Display: quickly blank the display without losing what’s on it. TextDirection: control which way text flows from the cursor. Scroll: scroll text left and right. Serial input: accepts serial input, displays it. SetCursor: set the cursor position.

LiquidCrystal — Serial Input¶

The Liquid Crystal Library allows you to control LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface. This example sketch accepts serial input from a host computer and displays it on the LCD. To use it, upload the sketch, then open the Serial Monitor and type some characters and click Send. The text will appear on your LCD. Hardware Required

The Liquid Crystal Library allows you to control LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface. This example sketch shows how to use the setCursor() method to reposition the cursor. To move the cursor, just call setCursor() with a row and column position. For example, for a 2×16 display: lcd.setCursor(0, 0); // top left lcd.setCursor(15, 0); // top right lcd.setCursor(0, 1); // bottom left lcd.setCursor(15, 1); // bottom right

Arduino Board LCD Screen (compatible with Hitachi HD44780 driver) pin headers to solder to the LCD display pins 10k Potentiometer breadboard hook-up wire Circuit

Before wiring the LCD screen to your Arduino we suggest to solder a pin header strip to the 14 (or 16) pin count connector of the LCD screen, as you can see in the image above. To wire your LCD screen to your Arduino, connect the following pins: LCD RS pin to digital pin 12 LCD Enable pin to digital pin 11 LCD D4 pin to digital pin 5 LCD D5 pin to digital pin 4 LCD D6 pin to digital pin 3 LCD D7 pin to digital pin 2 Additionally, wire a 10K pot to +5V and GND, with it’s wiper (output) to LCD screens VO pin (pin3). click the images to enlarge

image developed using Fritzing. For more circuit examples, see the Fritzing project page

Demonstrates the use a 16×2 LCD display. The LiquidCrystal library works with all LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface.

This sketch prints to all the positions of the LCD using the setCursor(0 method:

  • LCD RS pin to digital pin 12
  • LCD Enable pin to digital pin 11
  • LCD D4 pin to digital pin 5
  • LCD D5 pin to digital pin 4
  • LCD D6 pin to digital pin 3
  • LCD D7 pin to digital pin 2
  • LCD R/W pin to ground
  • 10K resistor:
  • ends to +5V and ground
  • wiper to LCD VO pin (pin 3)

Library originally added 18 Apr 2008 by David A. Mellis library modified 5 Jul 2009 by Limor Fried (http://www.ladyada.net) example added 9 Jul 2009 by Tom Igoe modified 22 Nov 2010 by Tom Igoe

This example code is in the public domain.

// include the library code: #include <LiquidCrystal.h>

// these constants won’t change. But you can change the size of // your LCD using them: const int numRows — 2; const int numCols — 16;

// initialize the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// loop from ASCII ‘a’ to ASCII ‘z’: for (int thisLetter — ‘a’; thisLetter <- ‘z’; thisLetter++) <

// loop over the columns: for (int thisCol — 0; thisCol < numRows; thisCol++) <

// loop over the rows: for (int thisRow — 0; thisRow < numCols; thisRow++) <

> [Get Code] See Also:

lcd.begin() lcd.print() lcd.setCursor() for() Liquid Crystal Library Blink: control of the block-style cursor. Cursor: control of the underscore-style cursor. Display: quickly blank the display without losing what’s on it. TextDirection: control which way text flows from the cursor. Scroll: scroll text left and right. Serial input: accepts serial input, displays it. Autoscroll: shift text right and left.

LiquidCrystal — scrollDisplayLeft() and scrollDisplayRight()¶

The Liquid Crystal Library allows you to control LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface. This example sketch shows how to use the scrollDisplayLeft() and scrollDisplayRight() methods to reverse the direction the text is flowing. It prints “Hello World!”, scrolls it offscreen to the left, then offscreen to the right, then back to home. Hardware Required

Arduino Board LCD Screen (compatible with Hitachi HD44780 driver) pin headers to solder to the LCD display pins 10k Potentiometer breadboard hook-up wire Circuit

Before wiring the LCD screen to your Arduino we suggest to solder a pin header strip to the 14 (or 16) pin count connector of the LCD screen, as you can see in the image above. To wire your LCD screen to your Arduino, connect the following pins: LCD RS pin to digital pin 12 LCD Enable pin to digital pin 11 LCD D4 pin to digital pin 5 LCD D5 pin to digital pin 4 LCD D6 pin to digital pin 3 LCD D7 pin to digital pin 2 Additionally, wire a 10K pot to +5V and GND, with it’s wiper (output) to LCD screen’s VO pin (pin3). click the images to enlarge

image developed using Fritzing. For more circuit examples, see the Fritzing project page

Demonstrates the use a 16×2 LCD display. The LiquidCrystal library works with all LCD displays that are compatible with the Hitachi HD44780 driver. There are many of them out there, and you can usually tell them by the 16-pin interface.

This sketch prints “Hello World!” to the LCD and uses the scrollDisplayLeft() and scrollDisplayRight() methods to scroll the text.

  • LCD RS pin to digital pin 12
  • LCD Enable pin to digital pin 11
  • LCD D4 pin to digital pin 5
  • LCD D5 pin to digital pin 4
  • LCD D6 pin to digital pin 3
  • LCD D7 pin to digital pin 2
  • LCD R/W pin to ground
  • 10K resistor:
  • ends to +5V and ground
  • wiper to LCD VO pin (pin 3)

Library originally added 18 Apr 2008 by David A. Mellis library modified 5 Jul 2009 by Limor Fried (http://www.ladyada.net) example added 9 Jul 2009 by Tom Igoe modified 22 Nov 2010 by Tom Igoe

This example code is in the public domain.

// include the library code: #include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// scroll 13 positions (string length) to the left // to move it offscreen left: for (int positionCounter — 0; positionCounter < 13; positionCounter++) <

// scroll 29 positions (string length + display length) to the right // to move it offscreen right: for (int positionCounter — 0; positionCounter < 29; positionCounter++) <

AVR и Arduino

liquidcrystallБиблиотека LiquidCrystal содержит необходимые функции управления жидкокристаллическим дисплеем, созданным на базе контроллеров, совместимых с Hitachi 44780. В число этих дисплеев входит большое количество популярных алфавитно-цифровых устройств, для которых в библиотеке содержатся высокоуровневые функции инициализации, управления и вывода информации на экран. LiquidCrystal поддерживает работу как в 8-ми, так и в 4-х проводном режиме обмена данными.

Подключение библиотеки и дисплея

Использование данной библиотеки стандартно для платформы Arduino. Перед первым вызовом любых функций необходимо прописать режим, в котором работает дисплей и номера используемых выводов Arduino . Могут быть использованы любые цифровые вывода, в произвольном порядке. Этот факт значительно повышает универсальность библиотеки и позволяет использовать устройства индикации, совместно с другой периферией в уже готовых проектах.

Для 4-х проводного режима объявление библиотеки выглядит следующим образом:

LiquidCrystal lcd(RS, E, D4,D5,D6,D7);

Здесь lcd – имя, по которому производится вызов функций управления дисплеем. Параметрами являются номера выводов Arduino , к которым подключены соответствующие линии ЖК-индикатора:

  • RS – выбор регистра адрес/данные
  • E – разрешение чтения с шины
  • D 4- D 7 – 4 линии шины данных индикатора
Схема подключения ЖК-дисплея к Arduino
Схема подключения ЖК-дисплея к Arduino

После объявления имени используемого дисплея проводится инициализация дисплея.

lcd.begin(Ch,S, С hSz);

Данная функция выполняет инициализацию дисплея, а также задает количество строк S и символов в строке Ch . Также можно задать размер шрифта ChSz . По умолчанию последний равен 5 x 8.

Функции библиотеки LiquidCrystal

  • Вывод на дисплей

lcd.print();

Функция отображает на дисплее произвольную информацию, начиная с текущего положения курсора. В качестве аргумента можно использовать текстовую строку или переменную.

  • Установка положения курсора

lcd.setCursor( Pos , Str );

Устанавливает курсор ЖК-дисплея в позицию Pos , строки Str дисплея.

  • Установка нулевого положения курсора

lcd. home ();

Устанавливает курсор дисплея в нулевую позицию, строки 0 дисплея.

  • Очистка дисплея

lcd. clear ();

Стирает всю информацию с экрана

  • Включение/выключение дисплея

lcd. Display();

lcd. noDisplay();

  • Включение/выключение курсора

lcd. Cursor();

lcd. noCursor();

  • Включение/выключение мигания курсора

lcd. blink();

lcd. noblink();

  • Сдвиг информации на дисплее

Влево lcd. scrollDisplayLeft();

Вправо lcd. scrollDisplayRight();

  • Установка направления вывода текстовой строки

Слева направо lcd .leftToRight();

Справа налево lcd . rightToLeft ();

  • Создание произвольного символа

Lcd . createChar ( Adr , CH []);

Команда записывает в память дисплея произвольный символ. Запись выполняется по одному из первых 8 адресов (от 0 до 7) в памяти знакогенератора. Символ CH [] должен представлять собой массив из 8 байт. Для задания пикселей, в каждом байте используется только 8 младших бит.

Читать:
Какие марки электросамокатов взрываются

Похожие публикации