Skip to content

Instantly share code, notes, and snippets.

View idriszmy's full-sized avatar

Idris Zainal Abidin idriszmy

View GitHub Profile
@idriszmy
idriszmy / SumoRobot500gRC_Pico.ino
Last active August 23, 2024 15:07
This example is for controlling sumo robot 500g RC using Raspberry Pi Pico and wireless USB joystick.
/*********************************************************************
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
MIT license, check LICENSE for more information
Copyright (c) 2019 Ha Thach for Adafruit Industries
All text above, and the splash screen below must be included in
any redistribution
*********************************************************************/
/*******************************************************************************
* THIS SOFTWARE IS PROVIDED IN AN "AS IS" CONDITION. NO WARRANTY AND SUPPORT
* IS APPLICABLE TO THIS SOFTWARE IN ANY FORM. CYTRON TECHNOLOGIES SHALL NOT,
* IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR CONSEQUENTIAL
* DAMAGES, FOR ANY REASON WHATSOEVER.
********************************************************************************
* DESCRIPTION:
*
* This example is for controlling Ikedo Mini V2 using PS2 controller.
*
@idriszmy
idriszmy / IkedoMiniV2WithStrategies.ino
Last active August 21, 2024 14:03
Ikedo Mini V2 sumo robot with motor speed alignment, auto detection for edge and strategy (half moon) at DIP 1 and 4.
/*******************************************************************************
* THIS SOFTWARE IS PROVIDED IN AN "AS IS" CONDITION. NO WARRANTY AND SUPPORT
* IS APPLICABLE TO THIS SOFTWARE IN ANY FORM. CYTRON TECHNOLOGIES SHALL NOT,
* IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR CONSEQUENTIAL
* DAMAGES, FOR ANY REASON WHATSOEVER.
********************************************************************************
* DESCRIPTION:
*
* This example is for the Autonomous Sumo Robot with:
* - motor speed alignment
@idriszmy
idriszmy / Barcodes.py
Last active August 18, 2024 21:59
Scan barcodes and QR codes using Raspberry Pi Zero W and Raspberry Pi Camera V3
#!/usr/bin/python3
'''
- Raspberry Pi Zero W
https://my.cytron.io/p-raspberry-pi-zero-w-and-bundles
- Raspberry Pi Camera Module 3 - 12MP with Auto Focus lens
https://my.cytron.io/p-raspberry-pi-camera-module-3-12mp-with-auto-focus-lens
- Raspberry Pi Zero/W/WH 15cm Camera Cable
https://my.cytron.io/p-raspberry-pi-zero-v1.3-camera-cable
@idriszmy
idriszmy / code.py
Created June 25, 2023 03:16
Raspberry Pi Pico - Fast line following robot
'''
How it works:
- https://vt.tiktok.com/ZSLkkvWB7/
'''
import time
import board
import digitalio
import pwmio
import analogio
@idriszmy
idriszmy / pizerow_telegram_photo.py
Created June 15, 2023 14:20
Send photo through Telegram using Raspberry Pi Zero W and Pi Camera Module 3
'''
Send '/picam3' to your Telegram bot to request photo
Devices:
- Raspberry Pi Zero W
https://my.cytron.io/p-raspberry-pi-zero-w-and-bundles
- Raspberry Pi Camera Module 3
https://my.cytron.io/p-raspberry-pi-camera-module-3-12mp-with-auto-focus-lens
Install Telepot
@idriszmy
idriszmy / capture_photo.py
Created May 23, 2023 02:41
Capture photo with custom settings (exposure, gain, white balance, brightness, saturation, etc) for Pi Camera HQ M12.
import time
from picamera2 import Picamera2, Preview
picam2 = Picamera2()
picam2.start_preview(Preview.QTGL)
preview_config = picam2.create_preview_configuration()
capture_config = picam2.create_still_configuration()
picam2.configure(preview_config)
@idriszmy
idriszmy / capture_video.py
Last active May 23, 2023 02:41
Capture video with custom settings (exposure, gain, white balance, brightness, saturation, etc) for Pi Camera Module 3.
#!/usr/bin/python3
# Video result:
# https://www.facebook.com/idriszmyblog/videos/6655806037765900
import time
from gpiozero import Button
from picamera2 import Picamera2
from picamera2.encoders import H264Encoder
@idriszmy
idriszmy / NanoRP2040Theramin.ino
Created November 30, 2022 07:41
Build fun piano with ultrasonic using Maker Nano RP2040
#define echoPin 12
#define trigPin 13
#define led1 14
#define led2 15
#define buzzer 22 // buzzer pin in Maker Nano RP2040 is 22
// defines variables
long duration; // variable for the duration of sound wave travel
int distance; // variable for the distance measurement
@idriszmy
idriszmy / code.py
Last active November 6, 2022 09:32
Display bitmap file on SSD1306/SSD1315 OLED using Raspberry Pi Pico W and CircuitPython
#
# Display bitmap file on SSD1315 OLED using Raspberry Pi Pico W and CircuitPython
#
# References and credit to
# - https://tutorial.cytron.io/2021/12/21/display-image-on-the-graphic-lcd-using-maker-nano-rp2040-and-circuitpython/
#
# Raspberry Pi Pico W
# - [Maker Pi Pico Mini] https://my.cytron.io/p-maker-pi-pico-mini-simplifying-projects-with-raspberry-pi-pico
# Arduino Grove Sensor Kit for Beginner, OR
# - https://my.cytron.io/p-arduino-grove-sensor-kit-for-beginner