Showing posts with label DIY. Show all posts
Showing posts with label DIY. Show all posts

Monday, 2 January 2017

Braids - Chords

Making chords in a eurorack modular is really difficult
It at the most basic level requires 3 VCOs, a filter, VCA and EG


Mutable Instruments Braids has a number of modes that approximate chords, though there is no official chord mode

X3 mode is a good place to start
There are four variations of this mode

 /| /| x 3 mode  is 3 saw waves with individual tuning.
This mode is I think inspired by past synths like the miniMoog, EMS synthi, the electrocomp 101, etc. The saw waves can be tuned independently giving pseudo chords.

nn_X3 ... three square waves
The tuning of three oscillators is tied to the Coarse knob & Timbre knob.
By turning the timbre & Color knob, two of those oscillators can be detuned above or below the central tuning of the primary oscillator.
These two controls are quantized to “snap” on musical intervals like octaves or fifths.

 
 
/\X3.... three triangle waves

SIX3...... Three sine waves

/|/|/|/| ....... 7 super saws detuned

--------------------
The second pseudo-chord mode is the WTX4 mode
WTX4 is the wavetable times four page.
This mode is a 4-voice variant of the WLIN mode.

TIMBRE morphs through a small selection of 16 waves.
COLOR selects the harmonic structures between the 4 voices - from a predefined set of chords.
When COLOR is at 7 o’clock, all voices are playing the same note with a variable amount
of detuning, creating a thick chorus effect.


This is a great manual with the impt chord table for this mode.
http://www.vo1t.com/Euro//BraidsIllustrated1.8.pdf



There are a few variations in the original braids firmware which add extra chord modes.
Renaissance is a great place to start.
https://synthmodes.com/modules/braids_renaissance/#info

Sunday, 18 December 2016

New Sound Waves Synth Meet

Sunday 18th Dec, 2016.
Always great fun to catch up with my Synth mates.
This was the last meeting of 2016.

I think I want this sequencer.
It's from Red Light District. Totally Australian made.
 I understand they will be sold in Kit form too.
Its Eurorack format.

..




Another one for the shopping list:
Ornament & Crime
Voltage Controlled Labs
Muffs site


See you all in 2017.
Happy Christmas.

Saturday, 17 December 2016

Timer Interrupts and clocks - Part 2 - CTC Mode

 There are a few ways to do interrupts.
The last post was a basic intro on Timer Interrupts
in Arduino. It used the TimerOne Library
 
Another common way uses "Clear Timer on Compare Match" or CTC Mode.
The Uno has three timers called timer0, timer1, and timer2.  
Each of the timers has a counter that increases with each tick of the timer's clock. 
 
These interrupts are a good way of clocking events in Arduinos. 

CTC interrupts are triggered when the counter reaches a specific value.
This value is stored in the "Compare Match Register".
On reaching this value, the counter resets to zero.
You can set this specific counter value and you can also set the speed of the timer.
This allows you to control the frequency of the timer interrupts.
 
So the two important things to set when making your clock are:
1. speed of the timer
2. value of the counter reset

Speed.
The fastest speed of the Arduino clock is 16Mhz.
We can divide this speed , thus slowing things down using a "prescaler".
The formula for working out the speed is:
 
(timer speed (Hz)) = (Arduino clock speed (16MHz)) / prescaler
 
 
Counter Reset
Timer0 and timer2 are 8 bit timers. Thus they can store a max counter value of 255. 
Timer1 is a 16 bit timer. Thus it can store a max counter value of 65535.  
 
// --------------------------------------------------
 
Timer setup code is mostly done in the setup(){} function in an Arduino sketch.
We need to do things like turning on the CTC mode, setting the prescaler
 
Below is a example of some code:
 
//*********************
 
void setup(){

cli();//stop interrupts

//set timer0 interrupt at 2kHz
  TCCR0A = 0;// set entire TCCR0A register to 0
  TCCR0B = 0;// same for TCCR0B
  TCNT0  = 0;//initialize counter value to 0
 // set compare match register for 2khz increments
  OCR0A = 124;// = (16*10^6) / (2000*64) - 1 (must be <256)
// OCRnA/B is the output compare register 
 // turn on CTC mode
  TCCR0A |= (1 << WGM01);
  // Set CS01 and CS00 bits for 64 prescaler
  TCCR0B |= (1 << CS01) | (1 << CS00);   
  // enable timer compare interrupt
  TIMSK0 |= (1 << OCIE0A);
sei();//allow interrupts

}//end setup 
void loop() {
// put your main code here, to run repeatedly:

ISR(TIMER0_COMPA_vect){  //change the 0 to 1 for timer1 and 2 for timer2
   //interrupt commands here
// ******************** 
 
It all looks very confusing, but if you look at any CTC code, you will see these similar
lines of code:
 // turn on CTC mode
  TCCR0A |= (1 << WGM01);
It turns on the CTC mode 
The 3 Different timers will use slightly different code.
TCCR0A |= (1 << WGM01);//for timer0
TCCR1B |= (1 << WGM12);//for timer1
TCCR2A |= (1 << WGM21);//for timer2
----------------------------------- 
TCCR#A/B - this stands for "Timer/Counter Control Register".
This register holds the main control bits of the timer.
After TCCR there is a number and a letter A or B   
-------------------- 
The next bit of code involves setting the prescaler
// Set CS01 and CS00 bits for 64 prescaler
  TCCR0B |= (1 << CS01) | (1 << CS00);  
Each of the 3 timers uses a slightly different bit of code.
 TCCR2B |= (1 << CS22);  // Set CS#2 bit for 64 prescaler for timer 2
TCCR1B |= (1 << CS11);  // Set CS#1 bit for 8 prescaler for timer 1
TCCR0B |= (1 << CS02) | (1 << CS00);  
// Set CS#2 and CS#0 bits for 1024 prescaler for timer 0
 ---------------------
Next we have the Timer/Counter Register (TCNTn).
   TCNT0  = 0;//initialize counter value to 0
This register controls the counter value and is needed to set a preloader value.
Here, the preloader value is zero. 

The formula for the preloader value, for a required time (in seconds) is:

TCNTn = 65535 – (16x1010xTime in sec / Prescaler Value)

To calculate the preloader value for timer1 for a time of 2 Secs is:

TCNT1 = 65535 – (16x1010x2 / 1024) = 34285

 
 
------------------------------------------------- 
 These commands need to be placed outside the void setup() and void loop()
functions
 // ======================================================
ISR(TIMER0_COMPA_vect){  
   //this is for timer0
   //change the 0 to 1 for timer1 and 2 for timer2 
 // you would place all your timer commands here.
}
// =============================================== 
ISR stands for Interrupt Service Routine. 
TIMER1_COMPA_vect - this is your TIMER1/compare match interrupt.
When the TIMER1 matches the OCR1A, (ie: compare match interrupt == OCR1A)
an interrupt is generated. 
If we were using timer1 the commands would looks like this:
 ISR(TIMER1_COMPA_vect){


//this is for timer1 // you would place all your timer commands here. 
}
For the record there are three types of interrupts.
1. Compare Match interrupt (TIMER1_COMPA)
   These are good if you wish to toggle a pin or read from a sensor at precise
   regular intervals 
2. Overflow interrupt (TIMER1_OVF)
   Here, the timer clocks over 65535 ticks for timer1 and 255 ticks for timer 0&2 .  
3. Input capture interrupt (TIMER1_CAPT) 
   If a logic level change occurs on a specific pin , an input capture interrupt
   is generated. These are great if you want to measure the time between pulses
   or measure the frequency of an unknown signal.
// ================================================== 
 Below is an example of code using timer interrupts.
This uses timers 0,1 & 2. It works on the Arduino Uno.
// =========================================== 
 //timer interrupts
//by Amanda Ghassaei
//June 2012


/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
*/



//this code will enable all three arduino timer interrupts.
//timer0 will interrupt at 2kHz
//timer1 will interrupt at 1Hz
//timer2 will interrupt at 8kHz

//storage variables
// these are used in the timer command section at the end of the code
boolean toggle0 = 0;
boolean toggle1 = 0;
boolean toggle2 = 0;

void setup(){
  
  //set pins as outputs
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(13, OUTPUT);

cli();//stop interrupts

//set timer0 interrupt at 2kHz
  TCCR0A = 0;// set entire TCCR2A register to 0
  TCCR0B = 0;// same for TCCR2B
  TCNT0  = 0;//initialize counter value to 0
  // set compare match register for 2khz increments
  OCR0A = 124;// = (16*10^6) / (2000*64) - 1 (must be <256)
  // turn on CTC mode
  TCCR0A |= (1 << WGM01);
  // Set CS01 and CS00 bits for 64 prescaler
  TCCR0B |= (1 << CS01) | (1 << CS00);   
  // enable timer compare interrupt
  TIMSK0 |= (1 << OCIE0A);

//set timer1 interrupt at 1Hz
  TCCR1A = 0;// set entire TCCR1A register to 0
  TCCR1B = 0;// same for TCCR1B
  TCNT1  = 0;//initialize counter value to 0
  // set compare match register for 1hz increments
  OCR1A = 15624;// = (16*10^6) / (1*1024) - 1 (must be <65536)
  // turn on CTC mode
  TCCR1B |= (1 << WGM12);
  // Set CS12 and CS10 bits for 1024 prescaler
  TCCR1B |= (1 << CS12) | (1 << CS10);  
  // enable timer compare interrupt
  TIMSK1 |= (1 << OCIE1A);

//set timer2 interrupt at 8kHz
  TCCR2A = 0;// set entire TCCR2A register to 0
  TCCR2B = 0;// same for TCCR2B
  TCNT2  = 0;//initialize counter value to 0
  // set compare match register for 8khz increments
  OCR2A = 249;// = (16*10^6) / (8000*8) - 1 (must be <256)
  // turn on CTC mode
  TCCR2A |= (1 << WGM21);
  // Set CS21 bit for 8 prescaler
  TCCR2B |= (1 << CS21);   
  // enable timer compare interrupt
  TIMSK2 |= (1 << OCIE2A);


sei();//allow interrupts

}//end setup

ISR(TIMER0_COMPA_vect){//timer0 interrupt 2kHz toggles pin 8
//generates pulse wave of frequency 2kHz/2 = 1kHz 
//(takes two cycles for full wave- toggle high then toggle low)
 if (toggle0){
    digitalWrite(8,HIGH);
    toggle0 = 0;
  }
  else{
    digitalWrite(8,LOW);
    toggle0 = 1;
  }
}

ISR(TIMER1_COMPA_vect){//timer1 interrupt 1Hz toggles pin 13 (LED)
//generates pulse wave of frequency 1Hz/2 = 0.5kHz 
//(takes two cycles for full wave- toggle high then toggle low)
 if (toggle1){
    digitalWrite(13,HIGH);
    toggle1 = 0;
  }
  else{
    digitalWrite(13,LOW);
    toggle1 = 1;
  }
}
  
ISR(TIMER2_COMPA_vect){//timer1 interrupt 8kHz toggles pin 9
//generates pulse wave of frequency 8kHz/2 = 4kHz 
//(takes two cycles for full wave- toggle high then toggle low)
 if (toggle2){
    digitalWrite(9,HIGH);
    toggle2 = 0;
  }
  else{
    digitalWrite(9,LOW);
    toggle2 = 1;
  }
}


void loop(){
  //do other things here
}
// ============================================================== 
Links
+ https://circuitdigest.com/microcontroller-projects/arduino-timer-tutorial
+ https://www.youtube.com/watch?v=2kr5A350H7E 
 

Tuesday, 6 December 2016

Sauce of Unce - NLC - Build notes

This is a Eurorack module based upon the Buchla 265 Source of Uncertanity module.
The 265 is the first in a long string of modules bearing the name "Source of Uncertainity" which I
think is poetic and apt for such a module.


The Buchla 265 is one of  the greatest modules Don ever built.
However, the original 265 uses lots of rare and expensive parts and needs +24V to operate so is out of reach of most people.

The Nonlinearcircuit module though not a complete clone is very close.
The noise source uses a TL074 (quad op-amp). The 265 used four uA741s (single Op-amp).
The 0.05-50 Hz VCO is op amp based (again TL074).
The Sample & Hold sections are changed to use the hi-Z input of TL074 op amps (ie not uA741s). 
The 265 used an uA741 at the S/H output.

I've often wondered where did the name "unce" come from?
Maybe as it's the written form of the sound heard in most club music, Andrew named it from there? You have probably heard the sound unce,unce,unce,unce, etc coming from a club.


Andrew's build notes are here:
http://www.sdiy.org/pinky/data/Sauce%20of%20Unce%20build%20notes.pdf

NLC Blog descriptions:
http://nonlinearcircuits.blogspot.com.au/2014/04/sauce-of-unce.html
and
http://nonlinearcircuits.blogspot.com.au/2014/07/sauce-of-unce-in-eurorack.html

I'll be building two versions: one for the Buchla system & one for the Euro.

First the Eurorack one.
This is what the virgin boards look like.
There are four surface mount TL074 op-amps and some passive resistors in SMD format.
The rest of the build is through the hole.

There are two sides to this PCB

I like to get the SMD op amps onto the board first. Be careful there are no shorts.
Then the rest of the passive SMD stuff. The spacing is for 1206 SMDs.
I'm using 0805 SMDs. 
The 47K resistor  next to the 4u7 cap (marked in yellow) should be added last.
It sets the level of the noise output and determines the behaviour of the entire circuit.
It's value can range from 47K to as low as 12K if you have noisy transistors.
read Andrew's build notes for more info.

T1, T2 & T3 are test points.
T1: should just be noise like the three noise outputs
T2: a noisy approx 100Hz tri wave
T3: turn up the random pot to max, depending on your vactrol you should hear approx 30Hz +/-10V signal .
T3 is the output of the VCO that controls the S&H on the 'random' output, 

The orange & blue circles mark resistors that should be left out or changed. These set the output voltages.
Euro require voltages in the 0-5V range.
Buchla require a 0-10V or 0-15V range.

The blue circle marks the 12K resistor which I'm changing to 6.8k to give a Euro voltage output (0-5V).
The Orange circle marks the 10K & 33K which I'm changing to just a link (on the 10K) to again give out Euro voltages.



I'm using a J112 for the FET.
 Caps next.
 I'm using 68uf ceramics for the decoupling caps.

I used a 10uf 50V non polarized electro here.
The remaining 10uf Electros were 35V
 Vactrol time.
Using a VTL 5C3/2 for the dual vactrol.
It's what I had on hand at the time.
Probably a VTL 5C2/2 would be better ??
The VTL 5C2/2 has slower attack and decay response times.

For the single vactrol I used a NSL 32.

Almost there.
Pots, LEDs & jacks now.
I used 510 Ohm SM resistors for the LEDs.
Before setting the noise levels with the resistor marked "47K" I had a listen with just headphones.
Yup !!! lovely noise.

I measured an average of 0.175V at pin 1 of the TL074.
It fluctuated  quite a bit.
So the resistor value was 62K
11000/0.175 = 62.857



I blew the 10 ohm resistor in the lower right corner of the pic. It's now replaced with a SMD 10Ohm.
The culprit was I think a short  between the dual vactrol and the resistor (now covered with plastic shrink).



 -----------------------------
For the Buchla module:
To get approx 0-10V, install the 10k and 33k resistors as described. To get it up to 15V, replace the 10k resistor. Use 0805 smd (which will fit nicely), so you can easily remove them, try 22k for starters.

Similarly, on the smooth output you can change the 10k resistor to increase the output voltage.  
The build guide I suggests using 6k8 to 8k2 instead of the 12k. "The output still gets pretty hot but very rarely clips, this depends a lot upon your dual vactrol, so some experimentation is needed. I (Andrew F) used a rare dual Silonex. "Best to use 0805 resistors which can be easily installed and removed".

Another way is to use 6k8-8k2 as suggested to keep signal levels at comfortable (for the op amp) levels and then adjust the '10k*' resistor at op amp C1 to get the range you want, higher resistance = higher voltage.

 
 ------------------------

Links:
Muffs- 265sou

-----------------------------------------------------------------------------------
You can find more NLC builds here.
---------------------------------------------------------------------------------------

Wednesday, 30 November 2016

Squid Axon - NLC - Build notes

These are my build notes for the Nonlinearcircuits Squid Axon Eurorack module.

The Squid Axon is a circuit based on the Hodgkin- Huxley
 equation describing the chaotic behaviour observed in giant
squid axons.


Andrew's Build notes are here:
http://www.sdiy.org/pinky/data/Squid%20Axon%20build%20and%20BOM.pdf

Andrew's Blog info:
http://nonlinearcircuits.blogspot.com.au/2016/03/squid-axon.html

Basically it's a 4 stage analog shift register with two feedback paths, one nonlinear and one linear.


 I like to get the surface mount ICs on first.


I'm using this DG411 - from mouser.
 According to the specs, it requires the 100K & 120k resistors.

See Andrew's build notes.

 Get the rest of those SMDs on the board.
You're nearly there.





-----------------------------------------------------------------------------------
You can find more NLC builds here.
---------------------------------------------------------------------------------------

Thursday, 17 November 2016

LED blink Program using interrupts

 The classic LED blink program uses delay.
 
This version uses interrupts
 
Still flashes LED 13
 
 

Here is the code

/*
 * This is a interrupt version of the classic blink LED sketch
 */

// pins
const int led_pin = PB5; // PB5 is the same as pin 13


void setup() {
 
  // set LED pin to be a output
  DDRB |=(1<< led_pin);// using port B
 
}

void loop() {
 PORTB ^= (1<< led_pin);
 delay(200); // turns LED on/off
 

}
 
//7777777777777777777777777777777777777777

DDRB - The Port B Data Direction Register
 

Port registers allow for lower-level and faster manipulation of the i/o pins of the microcontroller on an Arduino board. The chips used on the Arduino board (the ATmega8 and ATmega168) have three ports:

  • B (digital pin 8 to 13)
  • C (analog input pins)
  • D (digital pins 0 to 7) 
 Port B pins can be either in or output.


Each port is controlled by three registers, which are also defined variables in the arduino language. 
The DDR register, determines whether the pin is an INPUT or OUTPUT. 
The PORT register controls whether the pin is HIGH or LOW.
The PIN register reads the state of INPUT pins set to input with pinMode(). 
 
 
 
Links
 
 
 
 
 

Tuesday, 15 November 2016

Arduino Binary Counters & MIDI - Super basic program

Though this is not directly related to music, but I think its good to know a little about bytes & bits.
Arduino's are digital devices and only understand computer language.
When you attach an analog voltage to one of the pins, it's translated into zeros and ones by a ADC.
 
Midi notes are also all about zeroes and ones. They are digital signals.


Here is a Decimal/Binary/Octal/Hex conversion table 

Binary numbers are zeros and ones. You can think of them like switches being on or off.
MIDI notes take the form of these binary numbers.
They can be divided into two types: command bytes and data bytes. 

Command bytes are always 128 or greater, or 0x80 to 0xFF in hexadecimal. 
If you convert these numbers to binary, you will see they range between
 10000000 to 11111111..... that is, the first number (MSB or most significant bit) is always a one.
This is how it knows its a Command byte.
These include things like note on, note off, pitch bend, aftertouch, continuous controller, channel pressure, .

Data bytes are always less than 127, or 0x00 to 0x7F in hex. 
If you convert these numbers to binary, you will see they range between
 00000000 to 01111111..... that is, the first number (MSB or most significant bit) is always a zero.
This is how it knows its a Data byte.
These include things like Pitch, Velocity , pitch bend amount & loudness.

MIDI commands are further broken down by the following system:

The first half of the MIDI command byte (the three bits following the MSB) sets the type of command. More info about the meaning on each of these commands is here.
10000000 = note off
10010000 = note on
10100000 = aftertouch
10110000 = continuous controller
11000000 = patch change
11010000 = channel pressure
11100000 = pitch bend
11110000 = non-musical commands

The last half of the command byte sets the MIDI channel. All the bytes listed above would be in channel 0, command bytes ending in 0001 would be for MIDI channel 1, and so on.

All MIDI messages start with a command byte, some messages contain one data byte, others contain two or more (see image above). For example, a note on command byte is followed by two data bytes: note and velocity.

--------------------------------------------------------------
Getting back to building the counter.
 This is a simple binary counter.
Just 4 LEDS., 4 resistors(330 ohms).
We use 4 digital pins.
Pretty basic, so a great learning tool.
 
Make sure that the longer lead (positive) of each LED is the one you connect to the Arduino pin and that the resistors connect the shorter lead (negative) to the GND rail.
 
I'll use digital pins 2, 3, 4, 5 
 
--------------------------------------------------------------

This is the initial code to test that the circuit works:
All 4 LEDs should light up

// variables
int pin2=2;
int pin3=3;
int pin4=4;
int pin5=5;  

void setup()
{
  // commands
  pinMode(pin2, OUTPUT);
  pinMode(pin3, OUTPUT);
  pinMode(pin4, OUTPUT);
  pinMode(pin5, OUTPUT);
}

void loop()
{
  // I want to step through each number from zero to 15
  // then I want to repeat
  digitalWrite(pin2, HIGH);
  digitalWrite(pin3, HIGH);
  digitalWrite(pin4, HIGH);
  digitalWrite(pin5, HIGH);
 
}
 

 
 --------------------------------------------------------------------------
 
The final code
Each number is written individually
This is really just an basic exercise on how to turn on/off LEDs in sequence.
A simple delay is added between each number
 
 
 
 // variables
int pin2=2;
int pin3=3;
int pin4=4;
int pin5=5;  
int waitTime=100;

void setup()
{
  // commands
  pinMode(pin2, OUTPUT);
  pinMode(pin3, OUTPUT);
  pinMode(pin4, OUTPUT);
  pinMode(pin5, OUTPUT);
}

void loop()
{
  // I want to step through each number from zero to 15
  // then I want to repeat
 
  //0
  digitalWrite(pin2, LOW);
  digitalWrite(pin3, LOW);
  digitalWrite(pin4, LOW);
  digitalWrite(pin5, LOW);
  delay(waitTime);
 
  //1
  digitalWrite(pin2, LOW);
  digitalWrite(pin3, LOW);
  digitalWrite(pin4, LOW);
  digitalWrite(pin5, HIGH);
  delay(waitTime);
 
  //2
    digitalWrite(pin2, LOW);
  digitalWrite(pin3, LOW);
  digitalWrite(pin4, LOW);
  digitalWrite(pin5, LOW);
  delay(waitTime);
 
  //3
    digitalWrite(pin2, LOW);
  digitalWrite(pin3, LOW);
  digitalWrite(pin4, HIGH);
  digitalWrite(pin5, HIGH);
  delay(waitTime);
 
  //4
    digitalWrite(pin2, LOW);
  digitalWrite(pin3, HIGH);
  digitalWrite(pin4, LOW);
  digitalWrite(pin5, LOW);
  delay(waitTime);
 
  //5
    digitalWrite(pin2, LOW);
  digitalWrite(pin3, HIGH);
  digitalWrite(pin4, LOW);
  digitalWrite(pin5, HIGH);
  delay(waitTime);
 
  //6
    digitalWrite(pin2, LOW);
  digitalWrite(pin3, HIGH);
  digitalWrite(pin4, HIGH);
  digitalWrite(pin5, LOW);
  delay(waitTime);
 
  //7
    digitalWrite(pin2, LOW);
  digitalWrite(pin3, HIGH);
  digitalWrite(pin4, HIGH);
  digitalWrite(pin5, HIGH);
  delay(waitTime);
 
  //8
    digitalWrite(pin2, HIGH);
  digitalWrite(pin3, LOW);
  digitalWrite(pin4, LOW);
  digitalWrite(pin5, LOW);
  delay(waitTime);
 
  //9
    digitalWrite(pin2, HIGH);
  digitalWrite(pin3, LOW);
  digitalWrite(pin4, LOW);
  digitalWrite(pin5, HIGH);
  delay(waitTime);
 
  //10
    digitalWrite(pin2, HIGH);
  digitalWrite(pin3, LOW);
  digitalWrite(pin4, HIGH);
  digitalWrite(pin5, LOW);
  delay(waitTime);
 
  //11
    digitalWrite(pin2, HIGH);
  digitalWrite(pin3, LOW);
  digitalWrite(pin4, HIGH);
  digitalWrite(pin5, HIGH);
  delay(waitTime);
 
  //12
    digitalWrite(pin2, HIGH);
  digitalWrite(pin3, HIGH);
  digitalWrite(pin4, LOW);
  digitalWrite(pin5, LOW);
  delay(waitTime);
 
  //13
    digitalWrite(pin2, HIGH);
  digitalWrite(pin3, HIGH);
  digitalWrite(pin4, LOW);
  digitalWrite(pin5, HIGH);
  delay(waitTime);
 
  //14
    digitalWrite(pin2, HIGH);
  digitalWrite(pin3, HIGH);
  digitalWrite(pin4, HIGH);
  digitalWrite(pin5, LOW);
  delay(waitTime);
 
  //15
  digitalWrite(pin2, HIGH);
  digitalWrite(pin3, HIGH);
  digitalWrite(pin4, HIGH);
  digitalWrite(pin5, HIGH);
  delay(waitTime);
}




Link
+ http://www.multiwingspan.co.uk/arduino.php?page=led5
 
 ---------------------------------
------------------------------------- 

Monday, 14 November 2016

3trins to banana breakout box


The 3trins mini patchbay is wonderful but at times difficult to see (esp in low light).
And I'm a big fan of bananas. .. they are stackable and fast.


My initial attempts were to build a permanent panel.
Soon ditched this in favour of one that I can plug in and remove when I like.


I'm using mini bananas:

Links:
https://www.muffwiggler.com/forum/viewtopic.php?p=2387506#2387506

Friday, 4 November 2016

TM1637 4-digit 7-segment display

There are many different display modules that use a TM1637 IC from Titan MicroElectronics.
The color, size, dots, and connection points can vary widely, but as long as they use the TM1637,
 most should work.
 

A naked  4-digit 7-segment display will use 12 pins on your arduino.
The TM1637 cuts this down to 4.
 

The 4 connections are 
VCC 5V/3.3V
GND
CLK (clock)
DIO (Data I/O)

CLK & DIO are connected to any arduino digital pins.
It's your choice.
 
Each display is actually a collection of 7 LEDs
The individual segments are labelled A to G
By setting each LED to high or low, we can turn them on/off
 
The TM1637 module includes four 0.36 segment 7-segment displays.
 
You’ll need to use a library or two.
 
Which one depends on the type of module you have.
Avishay Orpaz has written a great library for TM1637 displays, the TM1637Display library.  
 These require this compiler directive to be placed in your code:
// Include the library
#include <TM1637Display.h>

I have another TM display that uses the Grove library

You need to put this into your code:

// include the grove.seeedstudio library 
#include <TM1637.h> 
 And then define the pins
 
// Define the connections pins
#define CLK 2
#define DIO 3
 
Next, we need the function  
TM1637Display()
or
 TM1637 tm(2, 3);

This function requires two parameters:
the CLK pin and the the DIO pin.
TM1637Display display = TM1637Display(CLK, DIO);
OR 
 TM1637 tm(2, 3);
The code depends on the type of display you have.
Before you buy it, research what library it needs. 

The main functions include:

  • setSegments() – Set the raw value of the segments of each digit
  • showNumberDec() – Display a decimal number
  • showNumberDecEx() – Display a decimal number with decimal points or colon
  • setBrightness() – Set the brightness of the display
  • clear() – Clear the display
 Here is a simple display sketch.
It's actually the basic example in the ARDUINO IDE. 
 
These TM1637 Driver examples work well.
They all use the 
#include <TM1637.h> 
//************************** 
 code 1
This refers to displays that use the  #include <TM1637.h> library
To set the brightness, pass in a value between 0-7 into tm.setBrightness(); 
tm.display(); will display a character on the display. 
You are restricted to just 4 characters. 
Simply type in any alpha-numeric characters you wish. 
 

//*******************
#include <TM1637.h>


// Instantiation and pins configurations
// Pin 3 - > DIO
// Pin 2 - > CLK
TM1637 tm(2, 3);

void setup()
{
    tm.begin();
    tm.setBrightness(4);
}

void loop()
{
    // Display Integers:
    tm.display(1234);
    delay(1000);

    // Display float:
    tm.display(29.65);
    delay(1000);

    // Display String:
    tm.display("PLAY");
    delay(1000);
    tm.display("STOP");
    delay(1000);
}
//*******************************************************
  
Links
+ https://www.makerguides.com/tm1637-arduino-tutorial/
+ https://www.instructables.com/Tutorial-How-to-4-Digit-Display-Interface-With-Ard/ 
+ https://www.youtube.com/watch?v=6W7tycX-F1o&t=64s 
+ https://www.youtube.com/watch?v=l6QoGsdHzfM
 
 ---------------------------------
-------------------------------------