So Verry Confused!!

is it possible on arduino to be running commands while running a delay? can you make your own "void" things (eg. void jtilt) and have them running simultaneously?

Sort of yes. Instead of using delay(xxx), create your own funtion that use max the time your delay should last. It is only timing that counts.

When your routine is called, get the time from millis(), and when your routine stops, take another time. Compare if there's time left, and use the delay for the rest of the milliseconds you need. If your routine takes more time, than needed, are you in trouble, does the whole thing suffer because that?

It is a good idea. And there's probably even better methods, I just don't know them yet.

Cheers, Kari

TPV: is it possible on arduino to be running commands while running a delay?

The arduino's delay() function is a 'blocking' function, so nothing else can get done until it 'times out'. However there are other ways to perform delays while still allowing the sketch to continue running the loop() function. See the example sketch blink without delay.

can you make your own "void" things (eg. void jtilt) and have them running simultaneously?

Not sure I understand that question. One is free to write your own functions and then call them from your sketch. Nothing ever runs simultaneously in an Arduino sketch, however it's fast enough that with proper program structure it can seem to be able to handle multiple things at once. You may want to reframe your question if that doesn't itch your scratch.

Lefty

Since I had a Uno set up to test interrupts, I modified my sketch slightly to add a delay. This is it:

// interrupt service routine
void light_change ()
{
  digitalWrite (13, digitalRead (2));  
}

void setup()
{
  pinMode(13, OUTPUT);  
  attachInterrupt(0, light_change, CHANGE);
}  // end of setup

void loop() 
{
  delay (10000);
}  // end of loop

Basically this flashes the LED on pin 13 if there is an interrupt (on pin 2). And yes, the LED flashes even though the sketch is spending practically all its time in a delay.

So the answer is, yes, with interrupts, you can do it. However it may not be optimal. Your interrupt routine shouldn't be trying to do a huge amount. If it does, it may miss a second interrupt.