Version 4 SHEET 1 880 680 WIRE 80 -32 -144 -32 WIRE 176 -32 80 -32 WIRE 544 -32 336 -32 WIRE 80 32 80 -32 WIRE 336 32 336 -32 WIRE -144 128 -144 -32 WIRE 544 144 544 -32 WIRE 176 160 176 -32
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
const int trigPin = 3; | |
const int echoPin = 2; | |
void setup() | |
{ | |
// initialize serial communication: | |
Serial.begin(115200); | |
} | |
void loop() |
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
// pin definitions | |
// note: the echoPin has to be a pin which is allowed for interrupts, see here: https://www.arduino.cc/en/Reference/attachInterrupt | |
const int trigPin = 3; | |
const int echoPin = 2; | |
const int ledPin = 13; | |
const int speakerPin = 9; | |
// interrupt speed. the datasheet of the HC-SR04 suggests 60 ms, so chose 16 Hz | |
const float irqSpeed = 16.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
/** | |
* Quantize test: | |
* Arduino Nano pins for the MCP4822 DAC: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). | |
* potentiometer input: A0 | |
*/ | |
#include "SPI.h" | |
// pin numbers | |
const int ledPin = 13; | |
const int csPin = 10; |
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
/** | |
* 3 Hz sawtooth example with a DAC8718 | |
* Arduino Nano pins: | |
* CS: 10 | |
* MOSI: 11 | |
* MISO: 12 | |
* SCK: 13 | |
*/ | |
#include "SPI.h" |
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
# Python script for voltage logging | |
import os.path | |
import sys | |
import Gpib | |
import time | |
# GPIB Address = 24 | |
inst = Gpib.Gpib(0,24, timeout=60) | |
inst.clear() | |
inst.write("G8") |
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
segmentImage = Image.load("segment.png") | |
pi = 4*math.atan(1) | |
green = Color.new(0,255,0) | |
black = Color.new(0,0,0) | |
segmentSize = segmentImage:width() | |
segmentSpace = segmentSize - 2 | |
width = 480 + 2 * segmentSize | |
height = 272 + 2 * segmentSize | |
function init() |
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 math | |
# highest note frequency | |
c = 4186.01 | |
# distance factor between two notes | |
f = pow(2, 1.0/12.0) | |
# show frequncies | |
ds = [ 239, 253, 268, 284, 301, 319, 338, 358, 379, 402, 426, 451 ] |
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
#!/usr/bin/python3 | |
import json | |
import argparse | |
# parse command line arguments | |
parser = argparse.ArgumentParser() | |
parser.add_argument('master') | |
parser.add_argument('file_to_merge') | |
parser.add_argument('output_file') | |
args = parser.parse_args() |
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
; ATTiny25 implementation of a NAND | |
; PB1 and PB2 is input, with pullups, and PB0 is output | |
; fuse settings: disable CKDIV8 for 8 MHz clock | |
start: | |
; set PB0 as output, all other pins as input | |
ldi r20, 1 | |
out DDRB, r20 |
OlderNewer