Skip to content

Instantly share code, notes, and snippets.

View mbrav's full-sized avatar

Michael mbrav

  • Borrow Checker LLC
  • 192.168.1.0/24
  • LinkedIn in/mbrav
View GitHub Profile
@mbrav
mbrav / async_req.py
Last active December 14, 2021 19:53
Async requests with requests
import asyncio
import functools
import time
import requests
from tqdm import tqdm
def timer(func):
"""Timer Decorator for measuring execution performance
@mbrav
mbrav / Hummin.ino
Created September 16, 2016 02:30
A broken cathode tube display coming back to life in a new digital form — a material manifestation of Beethoven’s “Ode to Joy”.
// Hummin
// A broken cathode tube display coming back to life in a
// new digital form — a material manifestation of Beethoven’s “Ode to Joy”.
// Assembly: https://bfadtdeviceart.wordpress.com/2016/09/06/hummin/
// Created by Michael Braverman
// September 3, 2016
int cathodePin = 7;
@mbrav
mbrav / Feeduino.ino
Created August 10, 2016 07:53
Self feeding mechanism for feeding fish.
// Feeduino - Automatic Fish Feeder
// (c) Michael Braverman, November 2012.
// Video: https://youtu.be/1IwfZIiVXiA
#include <Servo.h>
Servo sServo; // Sweep servo (the one on the top)
Servo rServo; // Rotate servo (the one on the bottom)
int sDef = 70; // Sweep servo default possition
@mbrav
mbrav / EmotionCube.ino
Created August 10, 2016 07:44
A cube that senses physical movements, touches, changes in light intensity, and temperature
// Emotion Cube
// created by Michael Braverman
// October 8th, 2015
// Video: https://vimeo.com/144803164
#include <Metro.h>
// Read the sensor only once per 100ms (10Hz)
Metro metroSensor = Metro(100);
int led = 12;
int pot = 14;
int count;
int timeDelay;
int sensorValue = 0; // value read from the pot
int output = 0; // value output to the PWM (analog out)
/*
Artificial Personality Box
Created 3 May 2015
by Michael Braverman
*/
int whiteLED = 10;
int redLED = 12;
int greenLED = 9;
@mbrav
mbrav / PoemMaschine.ino
Last active August 10, 2016 07:41
An Arduino wired to a Thermal Printer and two buttons
/*
PoemMaschine v1.0
Created 19 Feb 2015
by Michael Braverman
Available Online: https://gist.github.com/mixania/813788550e25800a9159
*/
#include <EEPROM.h>
#include "SoftwareSerial.h"
@mbrav
mbrav / SensorCalibrateSimple.ino
Created September 29, 2015 20:14
A simpler way of calibrating a light sensor.
// Michael Braverman
// Lab Class
// 29 September 2015
// Pins
const int ledPin = 11;
const int lightPin = A0;
// States and numbers of the sensors and buttons
int lightVar;
@mbrav
mbrav / SensorCalibrate.ino
Last active September 29, 2015 18:54
An Arduino program that allows the user to fade the led either by using a potentiometer or a photoresistor. To switch between the two modes a push button must be pressed. The sketch also goes through a completely automated calibration process in the setup() that sets the sensor values automatically.
// Michael Braverman
// Lab Class
// 29 September 2015
// Pins
const int ledPin = 11;
const int buttonPin = 12;
const int lightPin = A0;
const int potPin = A1;
@mbrav
mbrav / FPS.ino
Last active July 26, 2022 21:12
A simple Arduino loop "FPS" counter - v1.1
/*
Simple Arduino loop FPS counter v1.1
Created 2 Mar 2015
Updated 22 Feb 2016
by Michael Braverman
CHANGE LOG
v1.1 - added optimizations
- changed '>' operators to '>='