#!/usr/bin/python
import time
import hal

import hal_racktoolchange

print 'setting up pins'
h =  hal_racktoolchange.setup_pins()
#h = hal.component("hal_racktoolchange")
#h.newpin("toolnumber", hal.HAL_S32, hal.HAL_IN)
#h.newpin("change", hal.HAL_BIT, hal.HAL_IN)
#h.newpin("changed", hal.HAL_BIT, hal.HAL_OUT)
#h.newpin("spindle_stopped", hal.HAL_BIT, hal.HAL_IN)
#h.newpin("tool_secure", hal.HAL_BIT, hal.HAL_IN)
#h.newpin("tool_released", hal.HAL_BIT, hal.HAL_IN)
#h.newpin("drawbar", hal.HAL_BIT, hal.HAL_OUT)
#h.newpin("blow", hal.HAL_BIT, hal.HAL_OUT)
print 'set up pins'
h.ready()

try:
    while 1:
        time.sleep(1)
except KeyboardInterrupt:
    pass
