Skip to content

Instantly share code, notes, and snippets.

View mizbit's full-sized avatar

David MiZak mizbit

View GitHub Profile
@mizbit
mizbit / Video_Audio_Downloader.js
Created April 27, 2023 06:19 — forked from thocell/Video_Audio_Downloader.js
The Tampermonkey userscript to download video and audio from Youtube, Twitter, Vimeo, Facebook, Dailymotion, 1tv, VK, youku, bilibili and 5000 more sites for free. Fast and easy to use.
// ==UserScript==
// @name Distill Video & Audio Downloader from 5000+ sites including Youtube, Support 1080P, 2K, 4k & 8K
// @namespace https://distillvideo.com/
// @version 2.1.1
// @date 2018-06-17
// @description Browser extension to download video and audio from Youtube, Twitter, Vimeo, Facebook, Dailymotion, 1tv, VK, youku, bilibili and 5000 more sites for free. Fast and easy to use.
// @author DistillVideo.com
// @copyright 2018, DistillVideo.com
// @homepage https://distillvideo.com/page/extensions
// @downloadURL https://distillvideo.com/js/ditillvideo.user.js
@mizbit
mizbit / ws2811_bridge.ino
Created October 16, 2022 00:22 — forked from Yona-Appletree/ws2811_bridge.ino
A simple Arduino program which uses Adafruit's NeoPixel library to relay serial-level RGB data to a series of WS2811-compatible LED modules attached to an output pin. The use of Adafurit's library requires double buffering in the serial-receive code, reducing the number of LEDs that can be driven with a single Arduino. It's possible that code co…
// include the neo pixel library
#include <Adafruit_NeoPixel.h>
// The number of LEDs being driven. This dictates how much data is expected in each frame read from the serial port.
static const int NUM_LEDS = 256;
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_RGB Pixels are wired for RGB bitstream
@mizbit
mizbit / githubpull.md
Created June 25, 2022 20:23 — forked from Jabarabo/githubpull.md
Gist of a stolen gist
@mizbit
mizbit / preparing_data_for_nextion.js
Created June 9, 2021 03:35 — forked from oriolrius/preparing_data_for_nextion.js
This is the code that I have in the node which prepares data before it is sent to the Nextion serial protocol.
var str = msg.payload;
var buf = [];
for (var i=0, l = str.length; i < l; i++) {
var ascii = str.charCodeAt(i);
buf.push(ascii);
}
buf.push(255);
buf.push(255);
buf.push(255);
@mizbit
mizbit / Speedometer_HMI.ino
Created November 7, 2020 19:23 — forked from matt448/Speedometer_HMI.ino
Arduino based speedometer using a Nextion HMI Display
#include "Nextion.h"
const int lightPin = 0;
const int hardwareCounterPin = 5;
const int samplePeriod = 1000; //in milliseconds
const float pulsesPerMile = 4000;
const float convertMph = pulsesPerMile/3600;
unsigned int count;
float mph;
@mizbit
mizbit / MainActivity.kt
Created September 15, 2020 01:03 — forked from patrickhammond/MainActivity.kt
Raspberry Pi 3 running Android Things driving an Arduino Uno to control an RGB LED
package com.madebyatomicrobot.things
import android.app.Activity
import android.os.Bundle
import android.util.Log
import android.widget.SeekBar
import android.widget.SeekBar.OnSeekBarChangeListener
import android.widget.TextView
import com.google.android.things.pio.PeripheralManagerService
import com.google.android.things.pio.UartDevice
@mizbit
mizbit / 12VIO_test.INO
Created August 23, 2020 21:57 — forked from macchina/12VIO_test.INO
Sketch to test PWM on the 12volt I/O (SOURCES 12volt)
#define MASTER_CLOCK 84000000
#include "SamNonDuePin.h"
uint32_t clock_a = 42000000; // Sampling frequency in Hz
int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by
const int IOENABLE = 6; // the number of the 12Vio_EN pin
@mizbit
mizbit / Fade.INO
Created August 23, 2020 21:57 — forked from macchina/Fade.INO
/*
Fade
Modified 6/6/16 to demonstrate Macchina 2.0 RGB LEDs,
also functioning as a HELLO WORLD type sketch.
This example shows how to fade an LED on the RGB LED
using the analogWrite() function.
The analogWrite() function uses PWM, so if
@mizbit
mizbit / LowPowerControl.INO
Created August 23, 2020 21:57 — forked from macchina/LowPowerControl.INO
Demonstrates how to turn on and off switched 12V and 5V rails.
#include "SamNonDuePin.h"
const int LPC = PIN_EMAC_ERX0; // LOW POWER CONTROL pin
void setup() {
pinModeNonDue(LPC, OUTPUT);
digitalWriteNonDue(LPC, LOW); // LOW = no power at +12V_SW/+5V_SW
// HIGH = power at +12V_SW/+5V_SW
}
@mizbit
mizbit / PWM_nVPW.INO
Created August 23, 2020 21:57 — forked from macchina/PWM_nVPW.INO
Controls PWM/VPW level
#include "SamNonDuePin.h"
const int LPC = PIN_EMAC_ERX0; // LOW POWER CONTROL pin
const int PWM_nVPW = PIN_EMAC_EMDC; // PWM/VPW level control
void setup() {
pinModeNonDue(LPC, OUTPUT);
pinModeNonDue(PWM_nVPW, OUTPUT);
digitalWriteNonDue(LPC, HIGH); // LOW = no power at +12V_SW/+5V_SW