Skip to main content

imp.getpoweren()

Returns the current state of certain imps’ POWER_EN pin

Availability

Device
imp modules (imp002 and up) only

Returns

Bool — true if POWER_EN is set, otherwise false

Description

On solder-down imp modules, the high-power mode (3.3V) that is necessary for the WiFi to work is driven by a specific pin, POWER_EN.

This method only reports whether Squirrel has explicitly activated POWER_EN using:

imp.setpoweren(true);

and not whether POWER_EN is enabled for any other reason:, for instance when WiFi is powered up by impOS.

This function only exists on solder-down modules. Attempting to call this function on an imp which does not support POWER_EN, such as the imp001, will result in a Squirrel runtime error.

See imp.setpoweren() for more information on POWER_EN.