Skip to content

Instantly share code, notes, and snippets.


Suad Anwar suadanwar

View GitHub Profile
suadanwar / calculator.ino
Created September 19, 2019 09:20
This sample code is for Calculator Using 4x4 Keypad and I2C LCD on Arduino.
View calculator.ino
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 20, 2); // set the LCD address to 0x27 for a 16 chars and 2 line display
#include <Keypad.h>
const byte ROWS = 4;
const byte COLS = 4;
char keys [ROWS] [COLS] = {
{'1', '2', '3', '+'},
suadanwar /
Created March 12, 2021 05:03
This sample code is to Control WS2812B NeoPixel LED Stick Using Raspberry Pi Pico.
import array, time
from machine import Pin
import rp2
from rp2 import PIO, StateMachine, asm_pio
# Configure the number of WS2812 LEDs.
@asm_pio(sideset_init=PIO.OUT_LOW, out_shiftdir=PIO.SHIFT_LEFT,
autopull=True, pull_thresh=24)
suadanwar /
Last active September 22, 2022 02:23
This is sample code for template matching tutorial using OpenCV on Raspberry Pi
import cv2
import numpy as np
img = cv2.imread("Cover.jpg")
gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
template = cv2.imread("Raspberry Pi.jpg", 0)
w, h = template.shape[::-1]
count = 0
res = cv2.matchTemplate(gray_img, template, cv2.TM_CCORR_NORMED )
suadanwar /
Created November 12, 2020 04:09
This is sample code for Face Recognition using OpenCV on Raspberry Pi 400.
#! /usr/bin/python
# import the necessary packages
from import VideoStream
from import FPS
import face_recognition
import imutils
import pickle
import time
import cv2
suadanwar /
Created October 16, 2020 04:27
This sample code is for Send video to telegram bot using Raspberry Pi tutorial.
import telepot
from picamera import PiCamera
import RPi.GPIO as GPIO
import time
from time import sleep
import datetime
from telepot.loop import MessageLoop
from subprocess import call
suadanwar / smart_blind_stick.ino
Created January 23, 2020 06:18
This sample code is for Smart Blind Stick Tutorial.
View smart_blind_stick.ino
#define TRIGPIN1 2
#define ECHOPIN1 3
#define TRIGPIN2 5
#define ECHOPIN2 6
#define PIEZO 8
// defines variables
long Duration1;
int Distance1;
long Duration2;
suadanwar /
Last active November 30, 2021 10:47
This sample code is for home notification using Telegram bot and Raspberry Pi.
import telepot
import RPi.GPIO as GPIO
import time
import datetime
from telepot.loop import MessageLoop
PIR = 17
suadanwar / keypad_solenoid.ino
Created March 24, 2021 05:04
This sample code is Solenoid Door Lock Using Keypad Tutorial.
View keypad_solenoid.ino
Project: CUnlock the Soenoid Door Lock Using A Keypad and Maker Nano #ArduinoNano
Board: Arduino Nano (Maker Nano)
Nano | Relay
5V – VCC
A0 – SIG
Nano | Keypad
suadanwar / Solenoid_Relay.ino
Created January 30, 2020 08:57
This sample code is for Solenoid Door Lock with Relay on Arduino.
View Solenoid_Relay.ino
#define BUTTON 2 // the number of the pushbutton pin
#define RELAY 3 // the number of the relay pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
// initialize the pushbutton pin as an input:
suadanwar / OttoMakerPiRP2040.ino
Created June 5, 2021 16:53
This sample code is for OTTO DIY Robot using Maker Pi RP2040.
View OttoMakerPiRP2040.ino
/* Otto DIY Robot
by Suad Anwar
This sample code is for Otto DIY Robot using Maker Pi RP2040 board.
#include <Servo.h>
#define PIN_YL 12 //servo[0] left leg