Skip to content

Instantly share code, notes, and snippets.

@benevpi
benevpi / gist:91bbae38f800b5488cc657f7a1d17533
Created December 13, 2018 14:36
NeoTrellis M4 synth where the attack and systain are taken from the accellerometer values
/* Simple Audio library demonstration - pocket synth with C major scale and 4 wave types */
#include <Audio.h>
#include <Adafruit_NeoTrellisM4.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_ADXL343.h>
Adafruit_ADXL343 accel = Adafruit_ADXL343(123, &Wire1);
AudioSynthWaveform wave0, wave1, wave2, wave3;
AudioSynthWaveform *waves[4] = {
@benevpi
benevpi / gist:56ab722fd0ff0a4c7a7cdc5792835b65
Created December 13, 2018 17:31
NeoTrellis M4 Express sketch for a syth that takes the attack , sustain and bitcrusher values from the accellerometer. You'll need to install the libraries -- detail here: https://learn.adafruit.com/adafruit-neotrellis-m4/arduino-libraries
/* Simple Audio library demonstration - pocket synth with C major scale and 4 wave types */
#include <Audio.h>
#include <Adafruit_NeoTrellisM4.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_ADXL343.h>
Adafruit_ADXL343 accel = Adafruit_ADXL343(123, &Wire1);
AudioSynthWaveform wave0, wave1, wave2, wave3;
AudioSynthWaveform *waves[4] = {
import displayio
import board
from adafruit_display_text.label import Label
from adafruit_bitmap_font import bitmap_font
import time
import adafruit_touchscreen
ts = adafruit_touchscreen.Touchscreen(board.TOUCH_XL, board.TOUCH_XR,
board.TOUCH_YD, board.TOUCH_YU,
calibration=((5200, 59000), (5800, 57000)),
#include <Wire.h>
#include <SPI.h>
#include <WiFi101.h>
#include <Adafruit_NeoPixel.h>
const char* ssid = "yourwifissid"; // The SSID (name) of your Wi-Fi network
const char* pass = "yourwifipassword"; // The password of the Wi-Fi network
String payload; // Variables to accept data
@benevpi
benevpi / code.py
Created June 26, 2019 10:20
circuit python benchmarking
import time
import board
from digitalio import DigitalInOut, Direction, Pull
import neopixel
import storage
import sys
def write_out(markname, marktime):
try:
with open("/benchmarks.csv", "a") as bench:
@benevpi
benevpi / speedtest.ino
Created June 27, 2019 12:20
Arduino speed test
int y;
float z;
int start;
String board = "Arduino Nano Every";
int sensorValue;
long loops = 1000000;
void setup() {
#include "Adafruit_NeoTrellisM4.h"
#include <Audio.h>
//audio setup from the audio tool
AudioSynthSimpleDrum drum3; //xy=76,123
AudioSynthSimpleDrum drum4; //xy=77,181
AudioSynthSimpleDrum drum1; //xy=78,31
AudioSynthSimpleDrum drum2; //xy=78,77
AudioMixer4 mixer1; //xy=246,100
AudioEffectBitcrusher bitcrusher1; //xy=295,221
@benevpi
benevpi / weather.ino
Created October 3, 2019 10:13
weather station
#include <ArduinoJson.h>
#include <WiFi.h>
#include <FastLED.h>
#define NUM_BOARDS 1# define NUM_LEDS 64 * NUM_BOARDS
# define DATA_PIN 18# define CLOCK_PIN 5
import board
import neopixel
from adafruit_ble.uart_server import UARTServer
from time import sleep
import adafruit_thermistor
import analogio
import math
from adafruit_bluefruit_connect.packet import Packet
from adafruit_bluefruit_connect.location_packet import LocationPacket
import time
import array
import math
import board
import digitalio
try:
from audiocore import RawSample
except ImportError:
from audioio import RawSample