Skip to content

Instantly share code, notes, and snippets.

View suadanwar's full-sized avatar

Suad Anwar suadanwar

View GitHub Profile
#include "CytronMotorDriver.h"
CytronMD motorLeft(PWM_PWM, 11, 10);
CytronMD motorRight(PWM_PWM, 9, 3);
#define BT_TX 6
#define BT_RX 7
#include "SoftwareSerial.h"
SoftwareSerial BTSerial(BT_TX, BT_RX); // Maker UNO RX, TX
#define BUTTON 2
@suadanwar
suadanwar / DS18B20.ino
Created June 24, 2020 08:40
This sample code is for DS18B20 Waterproof Temperature Sensor Tutorial.
// Include the libraries we need
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal_I2C.h>
#define ONE_WIRE_BUS 9
float Celsius = 0;
float Fahrenheit = 0;
LiquidCrystal_I2C lcd(0x27, 20, 2); // set the LCD address to 0x27 for a 16 chars and 2 line display
@suadanwar
suadanwar / coin_sorting.ino
Created June 18, 2020 11:49
This sample code is for coin sorting and counting using Maker Nano.
#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 _5SEN 3
#define _10SEN 4
#define _20SEN 5
#define _50SEN 6
#define PIEZO 8
int count_5SEN = 0;
@suadanwar
suadanwar / face_recognition.py
Last active April 5, 2021 01:04
This sample code is for Face Recognition Tutorial using Raspberry Pi OS, Pi Camera, Python 3, and OpenCV
import io
import picamera
import cv2
import numpy
#Create a memory stream so photos doesn't need to be saved in a file
stream = io.BytesIO()
#Get the picture (low resolution, so it should be quite fast)
#Here you can also specify other parameters (e.g.:rotate the image)
@suadanwar
suadanwar / LEDketupat.ino
Created May 15, 2020 03:06
This sample code is for LED Ketupat Raya with Maker UNO tutorial.
/*
* This code will play a melody - Suasana Hari Raya https://www.youtube.com/watch?v=NbxbdmntX58
* using Maker Uno.
*
* Maker Uno: https://www.cytron.io/p-maker-uno
*
* Created by:
* 6 June 2018 Idris Cytron Technologies
*/
@suadanwar
suadanwar / mq2_ESP32.ino
Created May 7, 2020 11:05
This sample code is for MQ2 Gas Detector Using ESP32 and Blynk App.
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
BlynkTimer timer;
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";
@suadanwar
suadanwar / stripESP32.ino
Created April 29, 2020 07:01
This sample code is use to control the LED strip using Blynk App and ESP32.
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <Adafruit_NeoPixel.h>
#include <SPI.h>
#define PIN 27
#define NUMPIXELS 30
#define BLYNK_PRINT Serial
@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
@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 / 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";