Skip to content

Instantly share code, notes, and snippets.

View VeggieVampire's full-sized avatar

Nick Farrow VeggieVampire

  • n-i-c-k.com
  • The edge of space
View GitHub Profile
import pygame
import json
import subprocess
import os
def run_script(button):
os.system("pkill rtl_fm")
command = "rtl_fm -A lut -E deemp -f {} -M {} -s {} -r {} - | ffmpeg -nostats -loglevel quiet -r 200k -f s16le -ar {} -ac 1 -i - -f wav - | aplay -q -t wav > /dev/null 2>&1".format(
button["frequency"], button["modulation_mode"], button["sample_rate"], button["output_rate"], button["output_rate"])
subprocess.Popen(command, shell=True,
import subprocess
import os
import time
import sys
os.system("pkill rtl_fm")
FM_frequency = "103.3e6" #desired FM station
#FM_frequency = sys.argv[1] + "e6"
modulation_mode = "wbfm" #wideband FM
sample_rate = "200000" #lowpass/resample
import rtlsdr
import numpy as np
from scipy import signal
# Connect to the SDR and configure it
sdr = rtlsdr.RtlSdr()
sdr.sample_rate = 2.4e6 # 2.4 MHz sample rate
sdr.gain = 'auto'
# Define the frequency ranges to scan
@VeggieVampire
VeggieVampire / RTL-SDR-Signal-Detection.py
Last active December 29, 2022 08:14
This code creates an instance of the RtlSdr class, which represents an RTL-SDR device, and sets the center frequency of the device to 101.1 MHz using the center_freq property. It also sets a step size for the frequency changes in Hz. Next, the code initializes Pygame and creates a window using the pygame.display.set_mode() function. It also sets…
import rtlsdr
import pygame
import time
# Create an instance of the RtlSdr class
sdr = rtlsdr.RtlSdr()
# Set the center frequency of the RTL-SDR device (in Hz)
sdr.center_freq = 101.1e6
@VeggieVampire
VeggieVampire / FlickeringLightScript.cs
Created August 19, 2019 07:47
Flickering light script in unity 3D.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FlickeringLightScript : MonoBehaviour {
Light testLight;
public float minFlickerTime = 0.1f;
public float maxFlickerTime = 0.04f;
@VeggieVampire
VeggieVampire / SpotlightController.cs
Created August 18, 2019 08:44
Unity 3D Spotlight Fallow controller. Slow the speed down to have the light fall behind. "Lerp Spotlight "
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpotlightController : MonoBehaviour {
private Vector3 targetPos;
public float moveSpeed = 10f;
public GameObject followTarget;
public float Xoffset = 0f;
@VeggieVampire
VeggieVampire / telnet_connectivity_check.exp
Last active August 8, 2019 07:12
This is an expect script that establishes a connection to the IP and port you give it to check connectivity from a remote host.
#!/usr/bin/expect -f
#set multiPrompt {[#>$] }
#exp_internal 1
set NODE [lindex $argv 0];
set IPz [lindex $argv 1];
set Portz [lindex $argv 2];
set Passwdz [lindex $argv 3];
#log_file -noappend output.log
set timeout 1
set force_conservative 0 ;# set to 1 to force conservative mode even if
// the setup function runs once when you press reset or power the board
int led6 = 6;
int buzzer = 7;
int val = 0; //value for storing moisture value
int soilPin = A4;//Declare a variable for the soil moisture sensor
int soilPower = 2;//Variable for Soil moisture Power
/*
Morse Code Project
This code will loop through a string of characters and convert these to morse code. But first you have to get the password to start the morse code seation.
It will blink two LED lights and play audio on a speaker.
https://www.instructables.com/id/Arduino-Morse-Code/
*/
//**************************************************//
@VeggieVampire
VeggieVampire / Makefile
Last active July 9, 2018 07:54
Basic Perfect Makefile for compiling target .cpp files using g++.
Basic Perfect Makefile for compiling target .cpp files with SDL2 libraries using g++.
#USEAGE: copy Makefile to folder with .cpp files then type "make"
#OBJS specifies which files to compile as part of the project
OBJS = $(wildcard *.cpp)
#CC specifies which compiler we're using
CC = g++