Data Sheet

dScript
dScript User Manual v2.15
thread YardLightCtl 100
thread FlashRedLed const
main: yardLightState = 2 ; neither on or off to force initial setup
threadstart YardLightCtl
threadsuspend
YardLightCtl:
if Adc1>600 then
if yardLightState != on then
clientOutBuf[0] = 0x20 ; Relay Active
clientOutBuf[1] = 1 ; Relay 1
clientOutBuf[2] = 0 ; not timed
ETH002.Write(clientOutBuf, 3, clientInBuf, clientLength)
if clientLength == 1 then
if clientInBuf[0] == 0 then
yardLightState = on
LedBlue = on
threadstart FlashRedLed
endif
endif
endif
elseif Adc1<400 then
if yardLightState != off then
clientOutBuf[0] = 0x21 ; Relay Inactive
clientOutBuf[1] = 1 ; Relay 1
clientOutBuf[2] = 0 ; not timed
ETH002.Write(clientOutBuf, 3, clientInBuf, clientLength)
if clientLength == 1 then
if clientInBuf[0] == 0 then
yardLightState = off
LedBlue = off
threadstart FlashRedLed
endif
endif
endif
endif
threadsuspend
FlashRedLed:
LedRed = on
threadsleep 300
LedRed = off
threadsuspend
Copyright © 2016, Devantech Ltd.
All rights reserved.
www.robot-electronics.co.uk
37