This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define NS 64 | |
// Sine Wave Look-Up-Table, generated in Python: | |
/* | |
from numpy import * | |
bits = 12 | |
samps = 64 | |
A = 2**(bits-1) | |
X = linspace(0.0,1.0,samps) | |
Y = A*sin(2*pi*X) + A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <STM32FreeRTOS.h> | |
//NOTE the DRIVER_PIN is connected to the INTERRUPT_PIN via a wire | |
const int INTERRUPT_PIN = 11; | |
const int DRIVER_PIN = 13; | |
const int DRIVER_TASK_DELAY_MILLIS = 2; | |
const int DRIVER_TASK_RANDOM_BLOCKING_MICROS_MAX = 2000; | |
const int COMPETING_TASK_DELAY_MILLIS = 10; //decreasing this brings fault on faster | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <STM32FreeRTOS.h> | |
// Define the LED pin is attached | |
const uint8_t LED_PIN = LED_BUILTIN; | |
// We need a handle for ul | |
xTaskHandle waitTaskHandle = NULL; | |
QueueHandle_t mQueue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Estes 1/4A3-3T model rocket engine | |
ENGINE_DIAMETER = 13; | |
ENGINE_HEIGHT = 45; | |
// how far engines sticks out of bottom | |
ENGINE_OFFSET = 5; | |
// structural wall thickness | |
WALL_T = 1.0; | |
//material curing shrinkage compensation factor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from operator import mul | |
from functools import reduce | |
PRIMES = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, | |
67, 71, 73, 79, 83, 89, 97, 101] | |
LETTERS_BY_FREQ = list('esiarntolcdupmghbyfvkwzxqj') | |
LETTER_TO_PRIME = dict(zip(LETTERS_BY_FREQ,PRIMES)) | |
def ppencode(letter_str): | |
return reduce(mul,map(lambda l: LETTER_TO_PRIME.get(l,1),letter_str)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.misc import imsave | |
PIXELS_X = 256 | |
PIXELS_Y = PIXELS_X | |
COLOR_SOLID_WHITE = (255,255,255,255) | |
COLOR_SOLID_BLACK = (0,0,0,255) | |
COLOR_FULLY_TRANSPARENT_BLACK = (0,0,0,0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The MIT License (MIT) | |
# | |
# Copyright (c) 2017 Dan Halbert for Adafruit Industries | |
# Copyright (c) 2017 Kattni Rembor, Tony DiCola for Adafruit Industries | |
# | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from digitalio import DigitalInOut, Direction, Pull | |
import audioio | |
import board | |
import array | |
import time | |
import math | |
FREQUENCY = 440 # 440 Hz middle 'A' | |
SAMPLERATE = 8000 # 8000 samples/second, recommended! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def speedx(sound_array, factor): | |
""" Multiplies the sound's speed by some `factor` """ | |
indices = np.round( np.arange(0, len(sound_array), factor) ) | |
indices = indices[indices < len(sound_array)].astype(int) | |
return sound_array[ indices.astype(int) ] | |
def stretch(sound_array, f, window_size, h): | |
""" Stretches the sound by a factor `f` """ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
#FIRST TIME SETUP | |
#install esp-open-sdk, Espressif ESP-IDF, and micropython dependencies | |
echo "Installing esp-open-sdk, Espressif ESP-IDF, and micropython dependencies..." | |
sudo apt-get update | |
sudo apt-get install -y build-essential git make unrar-free unzip \ | |
autoconf automake libtool libtool-bin gcc g++ gperf \ | |
flex bison texinfo gawk ncurses-dev libexpat-dev \ | |
python sed libreadline-dev libffi-dev pkg-config \ | |
help2man python-dev python-serial wget linux-image-extra-$(uname -r) |
NewerOlder