April 2020
Intermediate to advanced
412 pages
9h 58m
English
We will create an application that displays text on a 1602 LCD display attached to our Raspberry Pi board:
#include <thread>#include <system_error>#include <unistd.h>#include <fcntl.h>#include <errno.h>#include <sys/ioctl.h>#include <linux/i2c-dev.h>using namespace std::literals::chrono_literals;enum class Function : uint8_t { clear = 0x01, home = 0x02, entry_mode_set = 0x04, display_control = 0x08, cursor_shift = 0x10, fn_set = 0x20, set_ddram_addr = 0x80};constexpr int En = 0b00000100;