Skip to content

Instantly share code, notes, and snippets.

View mpentler's full-sized avatar

Mark Pentler mpentler

View GitHub Profile
@mpentler
mpentler / vhf-wx-script.py
Last active November 28, 2022 02:08
Python RPI VHF Wx satellite recorder
# RPi zero RTL-SDR VHF weather satellite recorder
# Mark Pentler 2021 v0.1
from gpiozero import Button #import button from the Pi GPIO library
import time # import time functions
import os #imports OS library for Shutdown control
hold_time = 2
record_button_delay = 1
# define button GPIO pins
#include <avr/io.h>
#include <util/delay.h>
int ledPWM1 = 0;
int ledPWM2 = 1;
void setup() {
DDRB = 0b00011111;
PORTB = 0b00011100;
int ledPWM1 = 0;
int ledPWM2 = 1;
void setup() {
pinMode(ledPWM1, OUTPUT);
pinMode(ledPWM2, OUTPUT);
}
void loop() {
analogWrite(ledPWM1, random(50, 120));
// Conference Mood Badge - Mark Pentler 2020
// Tested with: ATTiny85 and 13
// Code rev: v0.3 07/08/2020
// 0.01: initial Arduino test code, ATMega328p based
// 0.1: Changed to ATTiny85, compiles fine
// 0.15: Switched to ATTiny13 and Microcore, switched to direct I/O and removed Arduino-like helper functions
// 0.2: Global LEDpin variable replaced with spare register - now 0 bytes RAM used!, compiled size now reduced by a third since 0.1!
// 0.3: Power improvements: ADC disabled saved 200-300ish microamps
#include <avr/sleep.h>
// Conference Mood Badge - Mark Pentler 2020
// Tested with: ATTiny85 and 13
//
#include <avr/sleep.h>
#include <avr/interrupt.h>
#include <avr/io.h>
uint8_t LEDpin = PB0; // start on green LED
void setup() {
#include <avr/sleep.h>
#include <avr/interrupt.h>
#include <avr/io.h>
uint8_t LEDpin = PB0; // start on green LED
void setup() {
// Configure our input and output pins
DDRB = 0b00000111; // PB0-2 as inputs, leave PB3 (4th bit) as output (0)
PORTB |= (1 << PB3); // enable the pull-up resistor on PB3
#include <avr/sleep.h>
#include <avr/interrupt.h>
#include <avr/io.h>
uint8_t LEDpin = PB0; // start on green LED
void setup() {
// Configure our input and output pins
DDRB = 0b00000111; // PB0-2 as inputs, leave PB3 (4th bit) as output (0)
PORTB |= (1 << PB3); // enable the pull-up resistor on PB3
#include <avr/sleep.h>
#include <avr/interrupt.h>
int LEDpin = PB0; // start on green LED
void setup() {
// Configure our input and output pins
DDRB = 0b00000111; // PB0-2 as inputs, leave PB3 (4th bit) as output (0)
PORTB |= (1<<PB3); // enable the pull-up resistor on PB3
#include <avr/sleep.h>
#include <avr/interrupt.h>
const int redLED = PB2; // Define the LED pins
const int yellowLED = PB1;
const int greenLED = PB0;
int LEDpin = greenLED; // start on green LED
void setup() {
#include <avr/sleep.h>
#include <avr/interrupt.h>
const int switchPin = 3; // Define our button pin
const int redLED = 2; // Now the LED pins
const int yellowLED = 1;
const int greenLED = 0;
int LEDpin = greenLED; // start on green LED