Skip to content

Instantly share code, notes, and snippets.

@microcontrollershub
microcontrollershub / Connecting_multiple_16*2_LCD_Display_to_Arduino.in_
Created June 19, 2018 03:11
Code for connecting 2 LCD display to Arduino board with just 7 digital I/O pins. Project explanation - https://youtu.be/DFX627wrCvE
// Connecting multiple 16*2 LCD Display to Arduino
// by Varad Kulkarni <http://www.microcontrollershub.com>
// Created on 18 June 2018
#include <LiquidCrystal.h>
LiquidCrystal lcd1(12, 11, 5, 4, 3, 2);
LiquidCrystal lcd2(12, 10, 5, 4, 3, 2);
// Change following variables as per your need
char * LargeText = " Connecting 2 - 16*2 LCD with Arduino by microcontrollershub. ";
// Scrolling display for 1602 LCD by Arduino
// by Varad Kulkarni <http://www.microcontrollershub.com>
// Created on 20 May 2018
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
// Change following variables as per your need
char * LargeText = " Understanding code for scrolling text on 16*2 LCD Display. ";
// Custom Character for 1602 LCD
// by Varad Kulkarni <http://www.microcontrollershub.com>
// Created on 9 May 2018
// Project link : https://youtu.be/Lkvu3Qug_PM
// Battery Full
byte BatteryF[8] = {
0b00100,
0b11111,
0b11111,
// OPT3001 with Arduino (Lux meter)
// by Varad Kulkarni <http://www.microcontrollershub.com>
// Created 28 March 2018
#include <Wire.h>
void setup()
{
Serial.begin(9600); // Initialize serial communication at 9600
Wire.begin(); // Initialize Arduino in I2C master.
Wire.beginTransmission(0x44); // I2C address of OPT3001 = 0x44
// Arduino as IO - Extender (Slave_Code)
// by Varad Kulkarni <http://www.microcontrollershub.com>
// Created on 16 March 2018
#include <Wire.h>
void setup()
{
Wire.begin(0x40); // Initialize Arduino as slave with addres 0x40
Wire.onReceive(receiveEvent); // Register event
// Arduino as IO - Expander (Master_Code)
// by Varad Kulkarni <http://www.microcontrollershub.com>
// Created 16 March 2018
#include <Wire.h>
//------------ Serial commands ------------
String LED_1_ON_Command = "LED 1 ON"; // I2C Command = 1
String LED_1_OFF_Command = "LED 1 OFF"; // I2C Command = 2
String LED_2_ON_Command = "LED 2 ON"; // I2C Command = 3
// Arduino as Slave Code
// by Varad Kulkarni <http://www.microcontrollershub.com>
// Created 08 March 2018
#include <Wire.h>
void setup()
{
Wire.begin(0x40); // Initialize Arduino as slave with addres 0x40
Wire.onReceive(receiveEvent); // Register event
// Arduino as Master Code
// by Varad Kulkarni <http://www.microcontrollershub.com>
// Created 08 March 2018
#include <Wire.h>
void setup()
{
Wire.begin(); // Initialize Arduino as Master
}
//------------ BLE commands ------------
String ReceivedString_1 = "all red";
String ReceivedString_2 = "all green";
String ReceivedString_3 = "hold";
String ReceivedString_4 = "A C green";
String ReceivedString_5 = "B D green";
String ReceivedString_6 = "shut down";
String ReceivedString_7 = "test";
String ReceivedString_8 = "resume";
String ReceivedString_9 = "ok";
#include <IRremote.h>
#include <SoftwareSerial.h>
IRsend irsend;
SoftwareSerial BTSerial(10, 11); // RX | TX
String ReceivedString_1 = "turn on TV";
String ReceivedString_2 = "turn off TV";
String ReceivedString_3 = "mute";
String ReceivedString_4 = "unmute";
String ReceivedString_5 = "volume up";
String ReceivedString_6 = "volume down";