func SetDoorOpen(value bool) { if value { C.io_set_bit(C.LIGHT_DOOR_OPEN) } else { C.io_clear_bit(C.LIGHT_DOOR_OPEN) } }
func Set_button_light(button int, floor int, value bool) { channel := C.int(encode_light(button, floor)) if value { C.io_set_bit(channel) } else { C.io_clear_bit(channel) } }
func SetFloorIndicator(floor int) bool { if floor < 0 || floor > 3 { return false } if (floor & 0x02) != 0 { C.io_set_bit(C.LIGHT_FLOOR_IND1) } else { C.io_clear_bit(C.LIGHT_FLOOR_IND1) } if (floor & 0x01) != 0 { C.io_set_bit(C.LIGHT_FLOOR_IND2) } else { C.io_clear_bit(C.LIGHT_FLOOR_IND2) } return true }
func RunBottomFloor() { if GetFloorSignal() != 0 { C.io_set_bit(C.MOTORDIR) //time.Sleep(time.Second * 1) C.io_write_analog(C.MOTOR, 2800) for C.io_read_bit(C.SENSOR_FLOOR1) == 0 { SetFloorIndicator(GetFloorSignal()) time.Sleep(time.Millisecond * 200) } SetFloorIndicator(GetFloorSignal()) C.io_write_analog(C.MOTOR, 0) } }
func Io_set_bit(channel int) { C.io_set_bit(C.int(channel)) }
func ioSetBit(channel int) { C.io_set_bit(C.int(channel)) }
func RunDown() { C.io_set_bit(C.MOTORDIR) //time.Sleep(time.Second * 1) C.io_write_analog(C.MOTOR, 2800) }
func IO_Set_Bit(channel int) { C.io_set_bit(C.int(channel)) }
func io_setBit(channel int) { _, err := C.io_set_bit(C.int(channel)) checkError(err) }