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 RunTopFloor() { if GetFloorSignal() != 3 { C.io_clear_bit(C.MOTORDIR) //time.Sleep(time.Second * 1) C.io_write_analog(C.MOTOR, 2800) for C.io_read_bit(C.SENSOR_FLOOR4) == 0 { SetFloorIndicator(GetFloorSignal()) time.Sleep(time.Millisecond * 200) } SetFloorIndicator(GetFloorSignal()) C.io_write_analog(C.MOTOR, 0) } }
func Io_clear_bit(channel int) { C.io_clear_bit(C.int(channel)) }
func ioClearBit(channel int) { C.io_clear_bit(C.int(channel)) }
func RunUp() { C.io_clear_bit(C.MOTORDIR) //time.Sleep(time.Second * 1) C.io_write_analog(C.MOTOR, 2800) }
func IO_Clear_Bit(channel int) { C.io_clear_bit(C.int(channel)) }
func io_clearBit(channel int) { _, err := C.io_clear_bit(C.int(channel)) checkError(err) }