Skip to content

Instantly share code, notes, and snippets.

View robertcedwards's full-sized avatar
🖼️
Framing

Robert C Edwards robertcedwards

🖼️
Framing
View GitHub Profile
@robertcedwards
robertcedwards / gist:4ec6c1a676ab79541f84abdfbff2f3d4
Created July 2, 2017 15:24
A4988 Stepper Motor Driver how to
http://howtomechatronics.com/tutorials/arduino/how-to-control-stepper-motor-with-a4988-driver-and-arduino/
@robertcedwards
robertcedwards / quickstart.sh
Created June 12, 2017 14:43
Simple HTTP Server - Python Quickstart
python -m SimpleHTTPServer <port>
@robertcedwards
robertcedwards / TinyTS_v11.ino
Created March 8, 2017 02:22
The Tiny-TS Touch Synthesizer
// (*) All in the spirit of open-source and open-hardware
// Janost 2016 Sweden
// The Tiny-TS Touch Synthesizer
// https://janostman.wordpress.com/the-tiny-ts-diy-touch-synthesizer/
// Copyright 2016 DSP Synthesizers Sweden.
//
// Author: Jan Ostman
//
// This program is free software: you can redistribute it and/or modify
@robertcedwards
robertcedwards / mighty.ino
Created February 24, 2017 13:57
Multiple Effects back from GUI for Mighty Midi Machine
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioInputI2S i2s2; //xy=56.142845153808594,137
AudioEffectFade fade1; //xy=249,28
AudioEffectDelay delay1; //xy=248,324
@robertcedwards
robertcedwards / int_to_const-char.ino
Created February 8, 2017 17:35
Arduino convert int to 5 character const char
current_SampleRate = current_SampleRate / 2; // half the sample rate each time
char c[5];
String str;
str = String(current_SampleRate);
str.toCharArray(c, 5);
u8x8.draw2x2String(0, 5, c);
u8x8.drawString(8, 5, "Hz");
@robertcedwards
robertcedwards / gist:8c42ad99b167192c272fd8a22cdae636
Created February 8, 2017 17:34
Teensy Audio Board - Pins Used
FMI:
The audio board uses the following pins.
6 - MEMCS
7 - MOSI
9 - BCLK
10 - SDCS
11 - MCLK
12 - MISO
13 - RX
14 - SCLK
@robertcedwards
robertcedwards / Arduino-midi-code.ino
Created October 27, 2016 18:47
Arduino midi library example with FastLED library
#include <FastLED.h>
#define NUM_LEDS 10
#define LED 13 //Debug LED
#define DATA_PIN 5 // Green
#define CLOCK_PIN 6 // Blue
CRGB leds[NUM_LEDS];
int ledPin = 13;
@robertcedwards
robertcedwards / teensy-usbmidi-code.ino
Created October 27, 2016 18:46
usbmidi library example with FastLED library.
#include <FastLED.h>
#define NUM_LEDS 14
#define DATA_PIN 5 // Green
#define CLOCK_PIN 6 // Blue
CRGB leds[NUM_LEDS];
void OnProgramChange(byte channel, byte program) {
delay(500);
if (usbMIDI.getChannel() == 1 && usbMIDI.getData1() == 8) // MIDI CC 8, Channel 1
@robertcedwards
robertcedwards / npm-fix.md
Created October 2, 2016 03:37
Fixing NPM permissions - You may receive an EACCES error when you try to install a package globally. This indicates that you do not have permission to write to the directories that npm uses to store global packages and commands.

Option 2: Change npm's default directory to another directory

There are times when you do not want to change ownership of the default directory that npm uses (i.e. /usr) as this could cause some problems, for example if you are sharing the system with other users.

Instead, you can configure npm to use a different directory altogether. In our case, this will be a hidden directory in our home folder.

Make a directory for global installations:

mkdir ~/.npm-global Configure npm to use the new directory path:

In the terminal, do this:
defaults write com.apple.finder CreateDesktop -bool false && killall Finder
After this, there'll be nothing on your Desktop (but still in ~/Desktop, i.e. your Desktop Folder). It'll look like this:
Clean Desktop
Beautiful, isn't it? If you want to change it back:
defaults write com.apple.finder CreateDesktop -bool true && killall Finder