Skip to content

Instantly share code, notes, and snippets.

@TiMladenov
Created August 5, 2018 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TiMladenov/659309ab33d7dbb9e8795b00c7120018 to your computer and use it in GitHub Desktop.
Save TiMladenov/659309ab33d7dbb9e8795b00c7120018 to your computer and use it in GitHub Desktop.
/*
Demonstration sketch for Adafruit i2c/SPI LCD backpack
using MCP23008 I2C expander
( http://www.ladyada.net/products/i2cspilcdbackpack/index.html )
This sketch prints "Hello World!" to the LCD
and shows the time.
The circuit:
* 5V to Arduino 5V pin
* GND to Arduino GND pin
* CLK to Analog #5
* DAT to Analog #4
*/
// include the library code:
#include "Wire.h"
#include "Adafruit_LiquidCrystal.h"
// Connect via i2c, default address #0 (A0-A2 not jumpered)
Adafruit_LiquidCrystal lcd(0x27);
void setup() {
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
}
void loop() {
delay(3000);
lcd.clear();
lcd.print("Hi, there!");
delay(3000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment