Skip to content

Instantly share code, notes, and snippets.

@UriShX
UriShX / Mirror_w_export_stream.pde
Created November 24, 2020 13:18
Processing sketch - stream video to v4l2loopback example
/**
* Streaming a Processing script to a v4l2loopback target example
* by Uri Shani
*
* Depends on running v4l2loopback before starting the script:
* '$ sudo modprobe v4l2loopback devices=3 video_nr=10,11,12 card_label="Loopback_1","Loopback_2","Virtual_cam" exclusive_caps=1,1,1'
*
* Ffmpeg is used first for streaming default webcam (/dev/video0) to two loopback devices,
* the sketch then uses Loopback_1 (/dev/video10) as its video source by listing available cameras, and selecting the second device (cameras[1], line 79).
*
@UriShX
UriShX / MIDI_MUX_CD4067_TEST.ino
Created February 5, 2020 21:05
Multiplex 64 analog values to a single Arduino pin, using MCP23x08 GPIO expander & CD4067 MUX
/*** Test skaetch for MIDI_MUX_SHIELD
* Use bit mask in MCP23x08 to enable a single channel on a single CD4067, then do analogRead
*
* based on library examples for https://github.com/sumotoy/gpio_expander
* and http://yaab-arduino.blogspot.co.il/2015/02/fast-sampling-from-analog-input.html
* timer function based on https://learn.adafruit.com/multi-tasking-the-arduino-part-2/timers
*
* fastAnalogRead8bit doesn't work ATM, attachced for reference.
*
* Written by Uri Shani, 2018. Part of AB4MC, see: https://hackaday.io/project/109296-arduino-blocks-for-midi-controllers
@UriShX
UriShX / AB4MC_64_Button_Matrix.ino
Created February 5, 2020 20:54
64 button matrix connected to Arduino through MCP23x17, based on Microchip app note AN1081
/*
* Depends on https://github.com/sumotoy/gpio_expander library for operating MCP23x17 port expander
* Depends on https://github.com/MajicDesigns/MD_CirQueue/blob/master/src/MD_CirQueue.h for circular queue operation.
* Algorithm based on Microchip app note AN1081, checked & working.
*
* Written by Uri Shani, 2018. Part of AB4MC project, see: https://hackaday.io/project/109296-arduino-blocks-for-midi-controllers
*/
#include <Arduino.h>
#include <mcp23s17.h>
@UriShX
UriShX / BLE_server_servo.ino
Created August 5, 2019 16:09
Moving a servo connected to a ESP32 dev board on pin 13, controlled via BLE. Control web app at: https://urishx.github.io/ESP32_fader/
/**
* Moving a servo connected to a ESP32 dev board on pin 13, controlled via BLE.
* Using a 9g servo, simple connections can be made from Lolin32 board to pin 13 for control, since it is next to
* 5V and GND pins (near battery connector, PH2). The ESP32 does not have enough power on its output pins for servos,
* so in actual use some power sourcing must be used, as well as a transistor to buffer the control pin from the servo.
* Control web app at: https://urishx.github.io/ESP32_fader/.
* Features auto ranging and sync via subscription.
* Also, outputs data to serial monitor, and uses freeRTOS queue to transfer servo position from one task to another.
* Written by Uri Shani, May 2019.
* MIT licensed (at least my very own original contributions).
@UriShX
UriShX / BLE_server_breathe.ino
Created August 5, 2019 15:14
Fading / breathing LED on a ESP32 dev board, controlled via BLE. Control web app at: https://urishx.github.io/ESP32_fader/
/**
* Fading / breathing LED on a ESP32 dev board, controlled via BLE.
* Control web app at: https://urishx.github.io/ESP32_fader/.
* Features auto ranging and sync via subscription.
* Also outputs data to serial monitor.
* Written by Uri Shani, May 2019.
* MIT licensed (at least my very own original contributions).
*
* Breathing LED from https://sean.voisen.org/blog/2011/10/breathing-led-with-arduino/
* also: https://arduinoelectronics.wordpress.com/
// Adjustment for reading / writing to google sheets via an embedded device (ESP32 kitchen scale)
// A part of https://hackaday.io/project/164849-yet-another-smart-kitchen-scale
// Adjusted by Uri Shani (@urishx) 2019
// Original script credentials:
// Written by: Akshaya Niraula,2016 November 12th, at http://www.embedded-lab.com/.....
// Adjustment for BME280 by Allan Schwartz at http://www.whatimade.today/log-unlimited-data-straight-to-google-sheets-from-a-bme280-temp/
// Further input from:
// https://github.com/simonbromberg/googlefitbit/blob/master/interday.gs
// HOW TO: