Showing posts with label delay. Show all posts
Showing posts with label delay. Show all posts

Tuesday, 12 November 2013

PLBP for chipKit DP32 { Proverbial (4) Led Blink Program }





Ok I just could not resist, and had to post the Proverbial Led blink Program adapted for the DP32, that has 4 LED's on the board ( Digital Pins 11 to 14).
Will scroll them from right to left, speed varying on the variable resistor on board( trim pot).






/* Proverbial (4) Led Blink Program
 
 Scrolls 4 light emitting diodes(LED), by turning on and off connected to 4 different digital  
 pins, using the delay() function and the current millis alike :) . 
 
 The circuit:
 * 4 LED's on board - pins D11, D12, D13 and D14 
 ** Variable resistor/trimpot on A2
 
 *** Version done for the chipKit board DP32 **
 ****  http://dubworks.blogspot.co.uk/
 */

// constants won't change. Used here to 
// set pin numbers:
const int ledPin =  11;      // the number of the LED pin
const int ledPin1 =  12; 
const int ledPin2 =  13; 
const int ledPin3 =  14; 
int i;
// Variables will change:
int ledState = LOW;             // ledState used to set the LED
int ledState1 = LOW;
int ledState2 = LOW;
int ledState3 = LOW;
long previousMillis = 0;        // will store last time LED was updated

// the follow variables is a long because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
//long interval = 500;           // interval at which to blink (milliseconds)

void setup() {
  // set the digital pin as output:
  pinMode(ledPin, OUTPUT);
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
  pinMode(ledPin3, OUTPUT);
  pinMode(A2, INPUT);
  ledState = !ledState;  //Toggle the bits to start
  ledState1 = !ledState1;
  ledState2 = !ledState2;
  ledState3 = !ledState3;  
}

void loop()
{
  boolean b; 
  long interval = analogRead(A2); // interval at which to enter function.(milliseconds)
  interval= interval/3; //So it is not too slow
  digitalWrite(ledPin, ledState);
  digitalWrite(ledPin1, ledState1);
  digitalWrite(ledPin2, ledState2);
  digitalWrite(ledPin3, ledState3); 
  // 

  // check to see if it's time 
  unsigned long currentMillis = millis();

  if(currentMillis - previousMillis > interval) {
    // save the last time  
    previousMillis = currentMillis;   
    // 
    int var;
    var=interval-(currentMillis - previousMillis);
    // conditional depending on increment accumulator
    if(!b){
      switch (i) {

      case 0 :    
        ledState = !ledState;
        digitalWrite(ledPin, ledState); 
        delay((var*0.5));
        break;

      case 1 :    
        ledState1 = !ledState1;
        digitalWrite(ledPin1, ledState1); 
        delay((var));
        break;

      case 2 :    
        ledState2 = !ledState2;
        digitalWrite(ledPin2, ledState2); 
        delay((var*1.5));
        break;

      case 3 :    
        ledState3 = !ledState3;
        digitalWrite(ledPin3, ledState3); 
        delay((var*2));
        break;

      default:
        b=!b;
        break;
      }
    }
    else{
      switch (i) {

      case 0 :    
        ledState = !ledState;
        digitalWrite(ledPin, ledState); 
        delay((var*2.5));
        break;

      case 1 :    
        ledState1 = !ledState1;
        digitalWrite(ledPin1, ledState1); 
        delay((var*3));
        break;

      case 2 :    
        ledState2 = !ledState2;
        digitalWrite(ledPin2, ledState2); 
        delay((var*3.5));
        break;

      case 3 :    
        ledState3 = !ledState3;
        digitalWrite(ledPin3, ledState3); 
        delay((var*4));
        break;

      default:
        b=!b;
        break;
      }
    }
    i++; // Increment our accumulator
    i=i%5; 
    // Keep the value within  the parameters needed for our switch case
    // in this case 5, so we can have 4 + 1 
    // (0, 1, 2 and 3) + 1 for default toggling of boolean variable b. (aesthetic reasons ?!)  
  }
}




Sunday, 11 November 2012

Update in pictures...


Delay ! PT2399, slightly mod'ed for reggae and dub production... Free running feedback "Emergency" toggle switch, modulation and control... LUSH !!

 LCD Back Pack and a 4046, part of a digital dubsiren based around the ATMega 328 ( Arduino Code available !)

 Initial tests to some synth stuff through midi, and of course...MIDI !!
Will be using the Pinguino board with a PIC32 at 80Mhz ...BOOM !
You even get space to add delay and all....

Proverbial Cheat sheet !!


Saturday, 21 July 2012

DubWorks Studio delay for dub and reggae productions

Studio delay ( DubWorks model, based around the Princeton Technologies  PT2399, redesigned for dub and reggae productions ) getting ready to leave premises..
This model was redesigned so it could give me all the sounds a good reggae and dub production needs( meaning old school grit and sounds)
This one is going to Brad The Manor, in London .



Tuesday, 26 June 2012

DIY DUBSIREN Kits (test PCB Boards)

My test PCB Boards( without ground plane, as they only test boards) just arrived...
So, after my tests, we will finally have available soon the DIY DUBSIREN Kits available !! 2 Diff models !! Nuff works happening !! 



Thursday, 29 March 2012


After realizing that Arduino has spread all around, despite the fact that i am a PIC man myself, but still i decided to give it a go, and start working on implement it with some of the projects i normally build. 
So intention is to develop a way of introducing an LCD, and interface control with the Arduino, and if not enough with the Atmel itself...
Intention is to have a nice graphic display of volume, specific relevant controls, etc, all through it...
So we wuld end up with an analog siren with top notch digital complements that would make them a few steps further in quality and number of sounds and features that a siren ( with or without delay) can offer...
All to make soundsystems, and DJ's armed with up-to-date sound gear.
Gonna take a while to develop the code, experiment etc, but im sure ill love it all the way !!
BOOOM !!!
PS-also seriously thinking of making DIY kits available soon, at least for some of the more basic builds, for those who want to build their own sirens, but dont have much knowledge to do it on their own...
So with nice tutorials, professional built PCB's, and the kit with necessary components, anyone with a steady hand and a bit of patient will be able to do it !!
If anyone has any ideas or opinions they would like to share in this field/question please let me know !!!




Tuesday, 27 March 2012

4 Pots, a momentary push button for triggering style, a toggle switch between permanent on siren and the push button.
two other switches with different capacitance, giving different oscillations.
Sounds like quick rising sirens are abound in this add on siren, that complements the other already shown


Testing it with the delay around the HT8972 IC ( cheap enough to have in a siren, at least if you want a budget thing).

New dub siren and basic "SIREN" delay ( around HT8972 Digital delay)





Thursday, 15 March 2012

Some videos of the dubsiren i been working on. This was the first batch model, and still available.
My intention after researching all the models out there ( NJD, SE10, etc) was to build one that was the most versatile. So i ended with this model where instead of presets style( through a rotary switch), went with the free form style of dubsiren as it makes all the sounds the others do and many more.
PS- contact me if you want to know more details or even order one. !