Basic semaphore library for arduino