Skip to content

Instantly share code, notes, and snippets.

View suadanwar's full-sized avatar

Suad Anwar suadanwar

View GitHub Profile
@suadanwar
suadanwar / bedLamp.ino
Created October 25, 2019 00:48
This sample code is for Colourful Bed Lamp Using Tilt Sensor on Maker UNO tutorial.
const int tiltPin = 2;
const int redLed = 11;
const int greenLed = 10;
const int blueLed = 9;
int tiltState;
int count = 0;
void setup() {
pinMode(redLed, OUTPUT);
@suadanwar
suadanwar / SmartDustbin.ino
Created December 6, 2019 04:52
This sample code is for Smart Dustbin Tutorial.
#include <Servo.h> // Include the Servo library
#define SERVO 3
#define TRIGPIN 12
#define ECHOPIN 11
#define PIEZO 8
Servo myServo; // Create a servo object
int val = 0;
long duration;
long distance;
@suadanwar
suadanwar / roboticArm.ino
Created January 10, 2020 00:45
This sample code is for a simple robotic arm tutorial.
#include <Servo.h>
Servo Servo_X;
Servo Servo_Y;
Servo Servo_Grip;
#define Joy_X A0
#define Joy_Y A1
#define BUTTON 2
@suadanwar
suadanwar / wirebuzz.ino
Created January 17, 2020 04:11
This sample code is for Wire Buzz tutorial.
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 20, 2); // set the LCD address to 0x27 for a 16 chars and 2 line display
#define PIEZO 8
#define WIRE 9
#define FINISH 10
#define NOTE_C5 523
#define NOTE_D5 587
#define NOTE_E5 659
@suadanwar
suadanwar / RFID_Solenoid.ino
Last active February 6, 2020 10:33
This sample code is for RFID Solenoid Door Lock with Arduino.
/*
--------------------------------------------------------------------------------------------------------------------
Example sketch/program showing how to read data from a PICC to serial.
--------------------------------------------------------------------------------------------------------------------
Typical pin layout used:
-----------------------------------------------------------------------------------------
MFRC522 Arduino Arduino Arduino Arduino Arduino
Reader/PCD Uno/101 Mega Nano v3 Leonardo/Micro Pro Micro
Signal Pin Pin Pin Pin Pin Pin
-----------------------------------------------------------------------------------------
@suadanwar
suadanwar / Multiple_Servo_Blynk.ino
Last active February 20, 2020 06:59
This sample code is for Control Multiple Servo Using Blynk App's tutorial.
/*************************************************************
Control multiple servo using a Blynk App!
App project setup:
*************************************************************/
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <ESP8266_Lib.h>
@suadanwar
suadanwar / water_plant_ESP32.ino
Last active February 20, 2020 07:18
This sample code is for Water The Plant Using ESP32.
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";
// Your WiFi credentials.
@suadanwar
suadanwar / mailbox_notification.ino
Created March 5, 2020 11:26
This sample code is for Mailbox Notification Using Blynk App tutorial.
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YourNetworkName";
@suadanwar
suadanwar / soap_dispenser.ino
Last active March 19, 2020 11:42
This sample code is for Automatic Soap Dispenser Using Maker UNO tutorial.
#include <Servo.h>
Servo myservo1; // create servo object to control a servo1
Servo myservo2; // create servo object to control a servo2
const int sensorPin = 3; // the number of the IR sensor pin
int sensorState = 0; // variable for reading the IR sensor status
void setup() {
// initialize the IR sensor pin as an input:
pinMode(sensorPin, INPUT);
@suadanwar
suadanwar / LED_timer.ino
Created March 26, 2020 13:42
This sample code is for Contact-Less Hand Washing LED Ring Timer Using Maker UNO tutorial.
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#define LED_RING 5
#define SENSOR 6
#define PIEZO 8
#define NUMPIXELS 12 // NeoPixel ring size