My question is if this is a legit way to do it or if I should expect any problems?
No, that sounds fine. A FET shouldn't really need a resistor - just make sure that at boot time you digitalWrite(0) to stop it floating, which could leave the sensor on/off.
Only thing I would add - are you powering the sensor from 3.3v, or from the LiPo? Because if it's from the LiPo you could hit problems - when the FET is off, the sensor will then be sitting at 3.7v (including the IO lines) which will be putting stress on the microcontroller. No problem if you're powering from 3.3v though
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
No, that sounds fine. A FET shouldn't really need a resistor - just make sure that at boot time you digitalWrite(0) to stop it floating, which could leave the sensor on/off.
Only thing I would add - are you powering the sensor from 3.3v, or from the LiPo? Because if it's from the LiPo you could hit problems - when the FET is off, the sensor will then be sitting at 3.7v (including the IO lines) which will be putting stress on the microcontroller. No problem if you're powering from 3.3v though