Skip to content

Instantly share code, notes, and snippets.

@HsienYu
HsienYu / test.ino
Created October 9, 2025 14:41
Test
/*
- Arduino DY-SV8F Audio Module Trigger via 2N2222
-
- Triggers audio playback on DY-SV8F module using transistor
- to simulate button press on I/O trigger pins
*/
// Define trigger pins (connect to 2N2222 base via 1k resistor)
const int TRIGGER_PIN_1 = 4; // Triggers IO_A (audio file 1)
@HsienYu
HsienYu / espexrenzo_uart.ino
Last active October 9, 2025 10:26
espexrenzo_uart.ino
// DY-HV8F Audio Player Control
#include <SoftwareSerial.h>
// Pin definitions
const int Pulsante = 3;
const int Rele = 4;
const int Occupato = 5;
const int DY_RX = 2; // Connect to DY-HV8F TX
const int DY_TX = 7; // Connect to DY-HV8F RX
@HsienYu
HsienYu / espexrenzo_simple.ino
Last active October 9, 2025 14:14
espexrenzo_simple.ino
// Simple DY-HV8F Control via Relay Button Simulation
const int Pulsante = 3;
const int Rele = 4; // Relay connected to DY-HV8F play button
const int Occupato = 5;
long t = 0;
long debounce_delay = 200;
bool audioStarted = false;
void setup() {
Serial.begin(9600);
@HsienYu
HsienYu / qscript20250314.scpt
Created March 25, 2025 20:07
AppleScript demo for controlling QLab audio cue level.
tell application "QLab"
try
tell front workspace
set theCue to first cue whose q number is "1"
if theCue is not missing value then
set cueType to q type of theCue
if cueType is "Audio" then
set currentLevel to (getLevel of theCue row 0 column 0)
set newLevel to currentLevel - 1
setLevel theCue row 0 column 0 db newLevel
#extension GL_OES_standard_derivatives : enable
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 resolution;
uniform vec2 mouse;
uniform float time;
@HsienYu
HsienYu / play.sh
Created December 15, 2022 12:47
rpi cvlc autoplay and loop
#!/bin/bash
sleep 1
cvlc -f -L --no-video-title-show /home/pi/Downloads/*.mp4
@HsienYu
HsienYu / installVNC.sh
Created December 9, 2022 11:18
install realVNC Rpi
#!/bin/bash
wget https://downloads.realvnc.com/download/file/vnc.files/VNC-Server-6.11.0-Linux-ARM.deb
sudo dpkg -i ~/VNC-Server-6.11.0-Linux-ARM.deb
@HsienYu
HsienYu / humanoid.ino
Created July 14, 2022 16:08
TingTong's Humanoid
#include <SPI.h>
#include <SdFat.h>
#include <SdFatUtil.h>
#include <SFEMP3Shield.h>
#include <Bounce2.h>
#include <VarSpeedServo.h>
#define B_NEXT A0
#define B_STOP A1
#define B_PLAY A2
@HsienYu
HsienYu / duo.py
Created June 12, 2022 20:41
duo client example
from __future__ import absolute_import
from __future__ import print_function
import json
import duo_client
from six.moves import input
ikey = ''
skey = ''
host = 'api-f6631762.duosecurity.com' # api-xxxxxxxx.duosecurity.com
@HsienYu
HsienYu / crop_storage.py
Created May 27, 2022 18:00
odoo15 Storage demo
from odoo import models, fields, api, _
class CropStorage(models.Model):
_name = 'agriculture.storage'
_inherit = 'mail.thread'
_description = 'Crop Storage'
_rec_name = 'StorageId'
StorageId = fields.Char(string='Storage Id', required=True)