Skip to content

Instantly share code, notes, and snippets.

View pixelpusher's full-sized avatar

pixelpusher pixelpusher

View GitHub Profile
import serial
import csv
import re
import matplotlib.pyplot as plt
import pandas as pd
portPath = "/dev/ttyACM0" # Must match value shown on Arduino IDE
baud = 115200 # Must match Arduino baud rate
timeout = 5 # Seconds
filename = "data.csv"
@pixelpusher
pixelpusher / Resample.hpp
Created March 8, 2019 07:54
Downsampling example for C++
/**
* Resampling algo from http://en.wikipedia.org/wiki/Lanczos_resampling
* Adapted by / copyright Evan Raskob <evan@flkr.com>, 2009-2019
* Free to use with attribution to all original authors / MIT License
* https://opensource.org/licenses/MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
let p5osc = Shape {
params = [ S "imgMode" Nothing, -- mirror, left, right, none
S "colorMode" Nothing, -- invert, firey, cool
F "brightness" (Just 1.0),
S "storm" Nothing, -- big, small, tiny, etc...
S "gsmode" Nothing --gray scott diffusion modes
],
cpsStamp = False,
C.latency = 0
}
@pixelpusher
pixelpusher / Algorave-blurb.txt
Last active March 22, 2016 13:44
Algorave blurb
Experimental, algorithm-aided, genre-misled, live-coded sound and visuals from the future coming to life before your eyes; bleeps, crashes, warts and all. Algorave is punk music of the next generation.
@pixelpusher
pixelpusher / ProfilePathAlignmentSpline2D.pde
Created May 10, 2015 11:48
ProfilePathAlignmentSpline2D
/**
* <p>Based on a toxiclibs example, a 2D polygon profile created using
* a smoothed triangle shape generatd by a 2D spline curve is being swept
* along a 3D spline path and aligned to the path direction using quaternions.
* This generates also a triangular mesha along the path that can be exported.
* The example demonstrates the usage of the alignment quaternion
* in combination with a 4x4 transformation matrix, as well as the use
* of the toAxisAngle() method to compute a rotation axis from a quat,
* and some manual mesh creation functionality.
* </p>
#svg {
width:400px;
height:400px;
background-color: #999;
}
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<svg>
/*
arduino_output
Demonstrates the control of digital pins of an Arduino board running the
StandardFirmata firmware. Clicking the squares toggles the corresponding
digital pin of the Arduino.
To use:
* Using the Arduino software, upload the StandardFirmata example (located
in Examples > Firmata > StandardFirmata) to your Arduino board.
@pixelpusher
pixelpusher / gist:8334424
Created January 9, 2014 13:54
Draw a triangle in Processing
size( 640, 480 );
background( 19, 18, 64 ); // R,G,B
stroke( 255, 0, 255 ); // purple stroke
int startX = 10;
int startY = 20;
@pixelpusher
pixelpusher / QuizGameModified.pde
Created March 9, 2012 14:05
QuizGameModified
/**
* Simple quiz game.
*
* by Evan Raskob
* UCA CGA, Farnham
*
* The Arena, 2012. Week 5+
*
* Your first task is to add the code to make questions 2 and 3 work. Have a look