Help needed with combining two sketches together

while(1)
{
Help! I'm stuck in a loop.
}