We’re rewarding the question askers & reputations are being recalculated! Read more.
4 Made question more clear
source | link

I am making a led cube where sequential lighting is used. So basically i need to repeat my commands for a given time. After much reasearch nothing turned up so decided to ask here.


Here is the code i need to reproduce in a working format

void loop(){
  runfor(500){
    DigitalWrite(5,HIGH);   //this is the command to be executed in other 
                            //function
  }
}
void runfor(uint32_t duration){
  int timer = millis();
  while((millis()-timer)<=duration){
  //get these commandsDigitalWrite(5,HIGH); fromwill callerexecute functionhere
  }
}

So basically DigitalWrite(or any other code if used) will be repeatedly executed for 500 milliseconds

I am making a led cube where sequential lighting is used. So basically i need to repeat my commands for a given time. After much reasearch nothing turned up so decided to ask here.


Here is the code i need to reproduce in a working format

void runfor(uint32_t duration){
  int timer = millis();
  while((millis()-timer)<=duration){
  //get these commands from caller function
  }
}

I am making a led cube where sequential lighting is used. So basically i need to repeat my commands for a given time. After much reasearch nothing turned up so decided to ask here.


Here is the code i need to reproduce in a working format

void loop(){
  runfor(500){
    DigitalWrite(5,HIGH);   //this is the command to be executed in other 
                            //function
  }
}
void runfor(uint32_t duration){
  int timer = millis();
  while((millis()-timer)<=duration){
  //DigitalWrite(5,HIGH); will execute here
  }
}

So basically DigitalWrite(or any other code if used) will be repeatedly executed for 500 milliseconds

    Post Closed as "unclear what you're asking" by gre_gor, Juraj, sempaiscuba, Greenonline, VE7JRO
3 Fixed Grammar
source | link

I am making a led cube where sequential lighting is used. So basically i need to repeat my commands for a given time. After much reasearch nothing turned uup so decided to ask here.


Here is the code i need to reproduce in a working format

void runfor(uint16_tuint32_t duration){
  int timer = millis();
  while((millis()-timer)<=duration){
  //get these commands from caller function
  }
}

I am making a led cube where sequential lighting is used. So basically i need to repeat my commands for a given time. After much reasearch nothing turned u so decided to ask here.


Here is the code i need to reproduce in a working format

void runfor(uint16_t duration){
  int timer = millis();
  while((millis()-timer)<=duration){
  //get these commands from caller function
  }
}

I am making a led cube where sequential lighting is used. So basically i need to repeat my commands for a given time. After much reasearch nothing turned up so decided to ask here.


Here is the code i need to reproduce in a working format

void runfor(uint32_t duration){
  int timer = millis();
  while((millis()-timer)<=duration){
  //get these commands from caller function
  }
}
2 Fixed Syntax
source | link

I am making a led cube where sequential lighting is used. So basically i need to repeat my commands for a given time. After much reasearch nothing turned u so decided to ask here.


Here is the code i need to reproduce in a working format

void runfor(intuint16_t duration){
  int timer = millis();
  forwhile((millis()-timer)<=duration){
  //get these commands from caller function
  }
}

I am making a led cube where sequential lighting is used. So basically i need to repeat my commands for a given time. After much reasearch nothing turned u so decided to ask here.


Here is the code i need to reproduce in a working format

void runfor(int duration){
  int timer = millis()
  for((millis()-timer)<=duration){
  //get these commands from caller function
  }
}

I am making a led cube where sequential lighting is used. So basically i need to repeat my commands for a given time. After much reasearch nothing turned u so decided to ask here.


Here is the code i need to reproduce in a working format

void runfor(uint16_t duration){
  int timer = millis();
  while((millis()-timer)<=duration){
  //get these commands from caller function
  }
}
1
source | link