Good day Jiggy-Ninja
Now we have it
See the attached scope shots.
I followed your advice, had to use one of older sketches which used the:
if(Pwm==pwmMax)
    {
     digitalWrite(outPin,LOW);
     delay(ramplengthpause);
    }
This piece of code along with your suggestion to put:
 }
       while(micros()-delayStartTime<=INTERVAL);
       digitalWrite(outPin,HIGH);
here, made all the difference. Here's the final void() loop:
void loop()
{
 int static Dir=1;
 if((micros()-StartUs) >= ramplength)
   {                    Â
    Pwm+=Dir;        //increment or decrement PWM depending of sign of Dir
    analogWrite(ledPin, Pwm); //Update built-in LED
    if(Pwm==pwmMax) Dir=-1; //if PWM reaches the maximum: change direction
    if(Pwm==pwmMax)
    {
     digitalWrite(outPin,LOW);
     delay(ramplengthpause);
    }
    if(Pwm==pwmMin)
    {
     digitalWrite(outPin,LOW);    Â
     delay(INTERVAL);
    Â
     Dir=+1;        //delay *INTERVAL* & change direction
     delayStartTime = micros();
    Â
       do
       {
        INTERVAL = map(analogRead(intervalPin),0,1023,800,50000);       //800=16ms     // adjust all maps according to
        pwmMax  = map(analogRead(pwmMaxPin),0,1023,100,255);          // circuit layout & potentiomenters
        ramplength = map(analogRead(ramplengthPin),0,1023,4,5800);  //5800=24ms     // adjust map for packetcount
        ramplengthpause==(ramplength/2);Â
       }
       while(micros()-delayStartTime<=INTERVAL);
       digitalWrite(outPin,HIGH);
    }           Â
   Â
    StartUs=micros();    //loose control of pwmMaxPin // ramplenghtPin & intervalPin works   // with int Dir=2; min 4ms
 }                // All three work!!!! but....now Triangle wave!!!!!         // with int static Dir=1;
Â
}
I might have to incorporate another do/while(micros()) function with this piece of code:
if(Pwm==pwmMax)
    {
     digitalWrite(outPin,LOW);
     delay(ramplengthpause);
    }
because the minimum pwmMax ramp length is just over 6ms and I need 3-4ms. Not sure if it will help but I'll try tomorrow.
Thanks for the advice, and yes I did learn a lot from this code..... PM me and I'll buy you a beer.
take care, peace
lost_bro

