Guest User

Untitled

a guest
Feb 16th, 2012
156
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if(mode == 8) {
  2.     //analogWrite(rtrigPinout, 255);
  3.     digitalWrite(rtrigPinout, HIGH);
  4.    
  5.     ltrigValue = analogRead(ltrigPin);
  6.     // if ltrigValue is more than half
  7.     if (ltrigValue < 655) {
  8.     knobValue = analogRead(knobPin); //get the delay setting from the knob
  9.     //lets change the 1/5 to 1/4 or 1/8
  10.         knobDiv = knobValue>>2;  //knobDiv = knobValue/4
  11.         digitalWrite(ltrigPinout, HIGH);
  12.         unsinged int i = 0x0;
  13.     delay(40);
  14.     for(i=0;i<=knobValue;i=i+knobDiv){//0,1/4,1/2,3/4,1 == 5 times
  15.             delay(knobValue);
  16.             ltrigValue = analogRead(ltrigPin);
  17.             //should define a threshold rather than chose < 1
  18.             //in the case there is some noise on the trigger line
  19.             //#define THRESH 10
  20.             if(analogRead(ltrigPin)){
  21.                 break;
  22.             }
  23.         }
  24.         digitalWrite(ltrigPinout,LOW);
  25.     }
  26. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×