Go Down

Topic: I need to to start the PWM in specific time  (Read 560 times) previous topic - next topic

ak95


I need to start the PWM from 4ms to 10ms and I did it with IF statement but nothing happend

so could any one help me

and one last thing the code that I wrote is



for (t;t<0.022; t=t+0.001)
{
  if ( (t>0.004) &&(t<0.011) )
  {
    aPin1 = (HIGH);
 analogWrite (aPin1 ,123);
  }
 else {
 aPin1 = (LOW);
 }
 if ( (t>0.014) && (t<0.021) )
 {
  bPin2 = (HIGH);
 analogWrite (bPin2 ,123);
 }
 else {
 bPin2 =(LOW);
 }
 if ( t = 0.021)
{
  t = 0 ;
}

CrossRoads

Need == here:
if ( t = 0.021)

What is t? millis() returns whole numbers, as does  micros().
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

ak95

Need == here:
if ( t = 0.021)

What is t? millis() returns whole numbers, as does  micros().
Need == here:
if ( t = 0.021)

What is t? millis() returns whole numbers, as does  micros().
yes I want t to work in mills

Go Up