AdnanSamra:
thank you Tim,to tell you the truth I am not a bit concerned about this as long as tasks that I assign the controller to do do not interfere or interrupt each other , so that is my only concern actually . i am working on a code were i need to initiate a relay while certain readings are obtained by an ultrasound sensor and start a sound for a certain period of time at the same time and then stopping it without interrupting the relay function at any time because the relay function could last for 1:30 hour or more,
so do you think that i can just use the readDigital function to read the pin I assigned as writeDigital (pin, High)
to activate the relay and link it in an If function to do the cut tones without affecting the relay function?thanks,
Simple answer, "Yup!". Once you change the state of a pin (from LOW to HIGH or whatever) it stays in that state till you change it (or you power the microcontroller down). The microcontroller doesn't need to multitask to keep the state of the pin the same, it's stuck in that state till you change it.
Tim