Skip to content

Instantly share code, notes, and snippets.

View VincentK16's full-sized avatar
:octocat:
Connect with me

Vincent Kok VincentK16

:octocat:
Connect with me
View GitHub Profile
@idriszmy
idriszmy / code.py
Last active January 3, 2022 02:39
Controlling relay via Telegram using Maker Pi Pico and CircuitPython.
"""
Controlling relay via Telegram using Maker Pi Pico and CircuitPython.
Items:
- Maker Pi Pico
https://my.cytron.io/p-maker-pi-pico
- ESP8266 ESP-01 WiFi Module
https://my.cytron.io/p-esp-01-wifi-serial-transceiver-module-esp8266
- Grove - Relay
https://my.cytron.io/p-grove-relay
@idriszmy
idriszmy / I2C_LCD_driver.py
Last active July 24, 2021 13:52
Displaying Malaysia Covid data on I2C LCD using Raspberry Pi
# -*- coding: utf-8 -*-
# i2c bus (0 — original Pi, 1 — Rev 2 Pi)
I2CBUS = 1
# LCD Address
ADDRESS = 0x27
import smbus
from time import sleep
@ariffinzulkifli
ariffinzulkifli / Arduino_NANO_transmit_to_NodeMCU.ino
Last active May 10, 2020 11:42
Arduino sketch for Arduino NANO to send data to NodeMCU using SoftwareSerial library
#include <SoftwareSerial.h>
#include <SimpleDHT.h>
SoftwareSerial softSerial(2, 3); // (RX, TX)
SimpleDHT11 dht11(5);
void setup() {
softSerial.begin(9600);
}
@VincentK16
VincentK16 / HC-SR04 Ultrasonic Sensor
Created July 1, 2013 11:34
This is a simple coding that display the distance of the obstacle to the sensor. When the sensor is approaching the obstacle, the buzzer will sound at a higher rate.
#include <NewPing.h>
#define TRIGGER_PIN 12 // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN 11 // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
void setup() {
Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results.