Environment-Driven Computing in Energy-Harvesting Devices