Skip to content

Instantly share code, notes, and snippets.

View IdrisCytron's full-sized avatar

Idris Zainal Abidin IdrisCytron

View GitHub Profile
@IdrisCytron
IdrisCytron / MicrobitSerialComm.py
Last active August 3, 2020 14:52
USB serial communication between Raspberry Pi and micro:bit.
from microbit import *
import music
music.play(["C4:1", "G4:1"])
pot_value = 0
pot_prev = 0
data_in = ''
while True:
@IdrisCytron
IdrisCytron / RPiQRScannerCSV.py
Created July 28, 2020 02:52
Record QR Data Into CSV Format Using Raspberry Pi.
from gpiozero import LED, Button, Buzzer
import cv2
import re
import csv
led = LED(19)
sw1 = Button(21)
buzzer = Buzzer(26)
@IdrisCytron
IdrisCytron / CameraQRScanner.py
Created July 21, 2020 01:15
Reading QR code using Raspberry Pi camera.
from gpiozero import LED, Button, Buzzer
import cv2
import re
led = LED(19)
sw1 = Button(21)
buzzer = Buzzer(26)
cap = cv2.VideoCapture(0)
@IdrisCytron
IdrisCytron / TelegramBotPhoto.py
Last active July 15, 2020 04:22
Capture and send photo to Telegram when magnetic contact switch is opened.
from gpiozero import Buzzer, DigitalInputDevice
import telepot
import picamera
sensor = DigitalInputDevice(17, pull_up=True)
buzzer = Buzzer(26)
def handle(msg):
global telegramText
global chat_id
@IdrisCytron
IdrisCytron / ESP32TTGOTelegramDHT.ino
Last active July 8, 2020 01:52
Monitor Temperature Humidity Using IoT Telegram Bot on ESP32
/*
Project: Monitor Temperature Humidity Using IoT Telegram Bot on ESP32
Board: ESP32 Dev Module (TTGO T-Display ESP32)
Connections:
ESP32 | DHT22
5V - VCC
GND - GND
IO27 - DAT
/*
Project: Display Heart Rate Data on IoT Blynk Using Arduino (Maker UNO)
Board: Arduino Uno (Maker UNO)
Connections:
Maker UNO | Finger-clip Heart Rate
5V - VCC
GND - GND
SDA - SDA
SCL - SCL
@IdrisCytron
IdrisCytron / ESP32S2Neopixel.ino
Created June 24, 2020 08:08
Controlling built-in WS2812B RGB LED on Cucumber board.
/*
Tutorial: Program ESP32-S2 Using Arduino IDE (Unofficial)
Board: ESP32S2 (Cucumber from Gravitech)
External libraries:
- Adafruit NeoPixel V1.5.0 (Manager)
*/
#include <Adafruit_NeoPixel.h>
#define PIN 18
@IdrisCytron
IdrisCytron / NanoDistanceAlert.ino
Last active June 17, 2020 02:34
Social Distancing Alert Wristband Using Arduino (Maker Nano)
/*
Project: Social Distancing Alert Wristband Using Arduino (Maker Nano)
Board: Arduino Nano (Maker Nano)
Connections:
Nano | VL53L0X
5V - VIN
GND - GND
A4 - SDA
A5 - SCL
@IdrisCytron
IdrisCytron / TelegramBotMakerpHAT.py
Last active June 9, 2020 05:12
Control LEDs and read buttons on Maker pHAT through Telegram Bot.
from gpiozero import LED, Buzzer, Button, OutputDevice
from time import time, sleep, strftime
from datetime import datetime
import telepot
led1 = LED(17)
led2 = LED(18)
led3 = LED(27)
led4 = LED(22)
led5 = LED(25)
@IdrisCytron
IdrisCytron / ESP32NTPClockRingLED.ino
Last active May 12, 2020 05:57
WS2812 Ring LED clock with NTP server using ESP32
/*
Project: WS2812 Ring LED clock with NTP server using ESP32
Board: ESP32 Dev Module (Node32 Lite)
Connections:
ESP32 | OLED Strip
RAW - VCC
GND - GND
25 - DIN