Architecture for an Adaptive, Energy-Efficient Microsystem Controller in Wireless Sensor Networks