Semaphore system with two motes using TinyOS