HELP ME TO CODE!!

(deleted)

Depends on activity but this should work ok. You just need to find out what activity you want to use as the code will be different depending on that. This code wont actually do anything before you add activity A and B

void loop(){
  Activity A //For example flash LED
  delay(5000);
  Activity B
  delay(5000);¨
}

void loop(){
Activity A //For example flash LED
delay(5000);
Activity B
delay(5000);¨
}

This will work but using delay() is blocking the rest of the code. So for 10 seconds in total your arduino is doing nothing. Is not responding to anything ( allmost ).

Look at BlinkWithoutDelay example in Arduino IDE. Then look here : Gammon Forum : Electronics : Microprocessors : How to do multiple things at once ... like cook bacon and eggs

aqmal_duino:
How do i code for example :

DO “ACTIVITY A” for 5 seconds the do “ACTIVITY B” for 5 seconds. Repeat.

Prints five seconds one string and five seconds another string to Serial as quickly as possible:

void setup() {
  Serial.begin(9600);
}

void loop() {
  if ((millis()/5000)%2) Serial.println("Activity B");
  else Serial.println("Activity A");
}

The condition to decide is “(millis()/5000)%2)” where “(millis()/5000)” creates a timing counter that is increasing every 5 seconds. And then this counter is tested if the modulo division by 2 has a remainder or not. So the condition is 5 seconds false, 5 seconds true, 5 seconds false and so on and different things are done.

Look at the demo several things at a time.

...R