Pixie: An Operating System for Resource-Aware Programming of Embedded Sensors