Create device.nut

This code partially works, but needs to be completed.