Pin State Read

How can i read pin state which is set to output mode?

// Variable to represent LED state
local ledState = 0;

// Variable to represent LED inhibit state
local inhibit = 0;

// input class for LED control channel
class input extends InputPort
name = "control"
type = “number”

function set(value)
if(value == 1)

  else if(value == 0)


// Configure pin 9 as an open drain output with internal pull up

// Register with the server
imp.configure(“Blinki”, [input()], []);

// Start blinking

// End of code.

This is a bug in Releases 1-7, sorry. All GPIO output types (DIGITAL_OUT, DIGITAL_OUT_OD, DIGITAL_OUT_OD_PULLUP) currently read as zero, whereas in fact the hardware is perfectly capable of reporting the actual state. I’ll try and get a fix into the next release.