this works for me, using nodemcu devkit, with v0.9.5 build 2015-02-13
DOUT = 6
SCLK = 5
gpio_mode = gpio.mode
gpio_read = gpio.read
gpio_write = gpio.write
INPUT = gpio.INPUT
OUTPUT = gpio.OUTPUT
HIGH = gpio.HIGH
LOW = gpio.LOW
gpio_mode(DOUT, INPUT)
gpio_mode(SCLK, OUTPUT)
gpio_write(SCLK, LOW)
out = "" -- 24 bit word
print("start")
while gpio_read(DOUT) == HIGH do end -- wait until DT goes LOW and ADC is ready to be read
for i=1,24 do
gpio_write(SCLK, HIGH)
out = out .. gpio_read(DOUT)
gpio_write(SCLK, LOW)
end
print(tonumber(out, 3))