Skip to content

Instantly share code, notes, and snippets.

View izzuddin91's full-sized avatar
🎯
Focusing

izzuddin cheras izzuddin91

🎯
Focusing
View GitHub Profile
@izzuddin91
izzuddin91 / test_relay_with_firestore.cpp
Created May 28, 2026 13:26
switch relay on and send data to firestore
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClientSecure.h>
#include <time.h>
const char* ssid = "<id>";
const char* password = "<pwd>";
const String FIREBASE_PROJECT_ID = "<id>";
const String API_KEY = "<api_key>";
@izzuddin91
izzuddin91 / test_led_display_and_push_button.cpp
Created May 28, 2026 13:24
to test parola display with push button. will light up led when button is pushed
#include <Arduino.h> //TEST FOR BUTTON PRESSED
#include <SPI.h>
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4
// MAX7219 pins
#define DATA_PIN D7
@izzuddin91
izzuddin91 / test_relay.cpp
Created May 28, 2026 13:21
ESP32 - test for relay
#include <Arduino.h>
#include <ThreeWire.h>
#include <RtcDS1302.h>
#define PIN_CLK D5
#define PIN_DAT D7
#define PIN_RST D8
#define RELAY_PIN D1 // Relay control pin
@izzuddin91
izzuddin91 / increment_relay_count.py
Last active August 11, 2019 13:26
hydroponic project august 2019 - iteration 1 complete package
#import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library
#from time import sleep # Import the sleep function from the time module
import os
import csv
r = csv.reader(open('/home/pi/Desktop/hydroponic_project/relay_running_count.csv')) # Here your csv file
lines = list(r)
original = lines[0][0]
print(lines[0])
@izzuddin91
izzuddin91 / switch.py
Created July 23, 2019 14:57
setting up switch to display information on matrix led
import RPi.GPIO as GPIO
import time
import os
import csv
GPIO.setmode(GPIO.BCM)
#pin bawah skali, seblah ground
GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_UP)
@izzuddin91
izzuddin91 / water_relay.py
Created July 23, 2019 14:41
setting up relay for hydroponic projects
import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library
from time import sleep # Import the sleep function from the time module
GPIO.setwarnings(False) # Ignore warning for now
GPIO.setmode(GPIO.BOARD) # Use physical pin numbering
GPIO.setup(8, GPIO.OUT, initial=GPIO.LOW) # Set pin 8 to be an output pin and s$
while True: # Run forever
GPIO.output(8, GPIO.HIGH) # Turn on
sleep(1) # Sleep for 1 second -> use this to set the interval for water pump
GPIO.output(8, GPIO.LOW) # Turn off
sleep(1) # Sleep for 1 second
@izzuddin91
izzuddin91 / max7219.py
Last active July 23, 2019 14:25
7 segemend LED matrix
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017-18 Richard Hull and contributors
# See LICENSE.rst for details.
import re
import time
import argparse
from luma.led_matrix.device import max7219
@izzuddin91
izzuddin91 / basic_oop.rb
Last active May 6, 2019 12:32
crops function2
class Crops
attr_accessor :sam #declare a variable named sam here
attr_accessor :luke #declare a variable named luke here
def initialize()
@sam = ["apple", "carrot"] #declare that sam has what
@luke = ["carrot"] #declare that luke has what
end
@izzuddin91
izzuddin91 / basic_process.rb
Created May 5, 2019 01:07
Crops function
puts "Please select crop number and separated by comma if more than one : \n 1) apple \n 2) pear"
a = gets.chomp
#receive string with comma separated
b = a.split(",")
# puts "#{b}"
b.each do |x|
#received string. convert to integer first
@izzuddin91
izzuddin91 / add_footer.swift
Created December 20, 2018 09:03
Swift iOS PDF