#include <LiquidCrystal_I2C.h> //アドレス0x27 16文字2行の液晶 LiquidCrystal_I2C lcd(0x27, 16, 2); void setup() { lcd.init(); lcd.backlight(); lcd.clear(); lcd.setCursor(0, 0); lcd.print("abc"); lcd.setCursor(3, 1); lcd.print("DEF"); } void loop() { }
#include <LiquidCrystal_I2C.h> //アドレス0x27 16文字2行の液晶 LiquidCrystal_I2C lcd(0x27, 16, 2); void setup() { int i=0xFFFF; lcd.init(); lcd.backlight(); lcd.clear(); lcd.setCursor(0, 0); lcd.print(i,DEC); lcd.setCursor(0, 1); lcd.print((unsigned int)i,DEC); } void loop() { }
#include <LiquidCrystal_I2C.h> //アドレス0x27 16文字2行の液晶 LiquidCrystal_I2C lcd(0x27, 16, 2); void setup() { unsigned int i=0xFFFF; lcd.init(); lcd.backlight(); lcd.clear(); lcd.setCursor(0, 0); lcd.print(i,OCT); lcd.setCursor(0, 1); lcd.print(i,HEX); } void loop() { }
#include <LiquidCrystal_I2C.h> //アドレス0x27 16文字2行の液晶 LiquidCrystal_I2C lcd(0x27, 16, 2); void setup() { unsigned int i=0xA5; lcd.init(); lcd.backlight(); lcd.clear(); lcd.setCursor(0, 0); lcd.print(i,BIN); lcd.setCursor(0, 1); lcd.print(i,5); } void loop() { }
#include <LiquidCrystal_I2C.h> //アドレス0x27 16文字2行の液晶 LiquidCrystal_I2C lcd(0x27, 16, 2); byte str[16] = {0x10, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0}; void setup() { lcd.init(); lcd.backlight(); } void loop() { for (int i = 0; i < 16; i++) { lcd.setCursor(0, 0); for (int j = 0; j < 16; j++) { lcd.write(byte(str[j] | (byte)i)); } delay(1000); } }
#include <LiquidCrystal_I2C.h> byte data_1[8] = { 0b00011111, 0b00010001, 0b00010001, 0b00010001, 0b00010001, 0b00010001, 0b00010001, 0b00011111, }; //アドレス0x27 16文字2行の液晶 LiquidCrystal_I2C lcd(0x27, 16, 2); void setup() { lcd.init(); lcd.createChar(0x00, data_1); lcd.backlight(); lcd.clear(); lcd.setCursor(0, 0); lcd.write(byte(0x00)); } void loop() { }
#include <LiquidCrystal_I2C.h> //アドレス0x27 16文字2行の液晶 LiquidCrystal_I2C lcd(0x27, 16, 2); char c[17]={0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF ,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00}; void setup() { lcd.init(); lcd.backlight(); lcd.clear(); lcd.setCursor(0, 0); lcd.print(c); lcd.setCursor(0, 1); lcd.print(c); } void loop() { }