Skip to content

Instantly share code, notes, and snippets.

View IdrisCytron's full-sized avatar

Idris Zainal Abidin IdrisCytron

View GitHub Profile
/*
This example shows how to get start with Cytron 4 Channel Motor Driver (FD04A)
and Maker UNO (Arduino Uno compatible)
Product page:
Cytron 4 Channel Motor Driver: https://www.cytron.io/p-fd04a
Maker UNO: https://www.cytron.io/p-maker-uno
Created by:
/*
This example shows how to measure motor's RPM through built-in
hall sensor encoder.
Product page:
DC Motor IG42E-24K: https://www.cytron.io/c-84-dc-motor/c-91-dc-geared-motor/c-494-ig42-with-encoder-planetary-gear/p-ig42e-24k
Cytron 10Amp DC Motor Driver: https://www.cytron.io/p-md10c
Maker UNO: https://www.cytron.io/p-maker-uno
/*
Project Video: https://www.youtube.com/watch?v=Dzq4tnJ0LjA
Product required:
1. Grove - Finger-clip Heart Rate Sensor
https://www.cytron.io/p-grv-heart-finger
2. Maker UNO:
https://www.cytron.io/p-maker-uno
Tutorial:
@IdrisCytron
IdrisCytron / Date_Time.py
Created September 19, 2018 01:43
I2C LCD library. Credit to Denis Pleic.
import I2C_LCD_driver
from time import sleep, strftime
from datetime import datetime
mylcd = I2C_LCD_driver.lcd()
mylcd.lcd_display_string("Internet Time", 1, 0)
while True:
mylcd.lcd_display_string(datetime.now().strftime('%b %d %H:%M:S'), 1, 0)
@IdrisCytron
IdrisCytron / I2CPiArduino.ino
Created September 24, 2018 04:42
Example of I2C communication between Raspberry Pi and Arduino
#include <Wire.h>
#define SLAVE_ADD 0x08 // Set Arduino I2C address
#define NOTE_C5 523
#define NOTE_E5 659
#define NOTE_G5 784
#define BUTTON 2
#define BUZZER 8
int pin;
@IdrisCytron
IdrisCytron / ArduinoRadar.pde
Last active October 2, 2018 02:51
DIY radar using Arduino and Processing. For more detail, please refer to Cytron Tutorial page.
/*
Project: Arduino Radar
Software: Processing IDE 3.4
Item used:
- Maker UNO
- Analog Distance Sensor (10-80cm)
- TowerPro MG946R Metal Gear Servo
*/
import processing.serial.*;
@IdrisCytron
IdrisCytron / I2CAnalogPiArduino.ino
Created October 9, 2018 09:13
Example of I2C communication between Raspberry Pi and Arduino. Reading analog signal.
#include <Wire.h>
#define SLAVE_ADD 0x08
#define NOTE_C5 523
#define NOTE_E5 659
#define NOTE_G5 784
#define BUTTON 2
#define BUZZER 8
#define POT_PIN A0
@IdrisCytron
IdrisCytron / I2CServoPiArduino.ino
Created October 16, 2018 01:15
Example of I2C communication between Raspberry Pi and Arduino. Controlling servo motor.
#include <Servo.h>
#include <Wire.h>
Servo myservo;
#define SLAVE_ADD 0x08
#define NOTE_C5 523
#define NOTE_E5 659
#define NOTE_G5 784
#define BUTTON 2
from gpiozero import LED, Button, Buzzer
from time import sleep
import os
LED1 = LED(17)
LED2 = LED(18)
LED3 = LED(27)
LED4 = LED(22)
LED5 = LED(25)
LED6 = LED(12)
@IdrisCytron
IdrisCytron / PiCameraTelegramBot.py
Last active May 11, 2024 05:29
Raspberry Pi Camera Telegram Bot. Youtube - https://www.youtube.com/watch?v=zAU0pKrk24o
import telepot
import picamera
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
def handle(msg):
global sendPhoto
global chat_id