本文整理匯總了Golang中C.io_clear_bit函數的典型用法代碼示例。如果您正苦於以下問題:Golang io_clear_bit函數的具體用法?Golang io_clear_bit怎麽用?Golang io_clear_bit使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了io_clear_bit函數的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: SetDoorOpen
func SetDoorOpen(value bool) {
if value {
C.io_set_bit(C.LIGHT_DOOR_OPEN)
} else {
C.io_clear_bit(C.LIGHT_DOOR_OPEN)
}
}
示例2: Set_button_light
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)
}
}
示例3: SetFloorIndicator
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
}
示例4: RunTopFloor
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)
}
}
示例5: Io_clear_bit
func Io_clear_bit(channel int) {
C.io_clear_bit(C.int(channel))
}
示例6: ioClearBit
func ioClearBit(channel int) {
C.io_clear_bit(C.int(channel))
}
示例7: RunUp
func RunUp() {
C.io_clear_bit(C.MOTORDIR)
//time.Sleep(time.Second * 1)
C.io_write_analog(C.MOTOR, 2800)
}
示例8: IO_Clear_Bit
func IO_Clear_Bit(channel int) {
C.io_clear_bit(C.int(channel))
}
示例9: io_clearBit
func io_clearBit(channel int) {
_, err := C.io_clear_bit(C.int(channel))
checkError(err)
}