Skip to content

Instantly share code, notes, and snippets.

View SimenZhor's full-sized avatar

Simen E. Sørensen SimenZhor

View GitHub Profile
@SimenZhor
SimenZhor / lsb_steganography.py
Created January 7, 2024 10:41
LSB Steganography
"""
Simple script that encodes an image into another image by hijacking the two least significant bits.
The script has only been tested on images that have the same dimensions and I've only done a half-hearted attempt at matching the image sizes.
"""
from PIL import Image
import numpy as np
import os
@SimenZhor
SimenZhor / Arduino_TC_PulseWidth_Measurement.ino
Created October 1, 2020 09:56
Using the Timer/Counter module to measure the width of input pulses on Arduino Uno pin 8 (and Nano (unverified)). Pin 8 (PORT B0) must be used as this is the only TC input pin.
// Pulse Width measurement using input capture unit
// Author: Simen E. Sørensen
//(overflow calculations based on code by Nick Gammon 31 August 2013:
// https://www.gammon.com.au/forum/?id=11504)
// Date: 01 October 2020
// Input: Pin D8 (Arduino Uno (and I think Arduino Nano as well))
volatile boolean risingEdge;
volatile boolean fallingEdgeFlag;