Skip to content

Instantly share code, notes, and snippets.

#include <IRremote.h>
const int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
IRsend irsend;
decode_results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
irrecv.blink13(true);
#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";
//------------ 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";
// 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
}
// 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 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 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
// 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
// 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,
// 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. ";