Untitled

 avatar
tuhuuduc
c_cpp
2 years ago
284 B
3
Indexable
Never
// C++ code
//
int n=2, limitIndex=10,delayTime=200;
void setup()
{
  for (int i=2;i<limitIndex;i++)
  pinMode(i, OUTPUT);
 
}

void loop()
{
  	digitalWrite(n, 1);
	delay(delayTime) ;
  	digitalWrite(n, 0);
  	delay(delayTime) ;
  	if (++n>limitIndex) 
      n=2;
}