示例#1
0
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)
	}
}
示例#2
0
文件: io.go 项目: CzarXerxes/Sanntid
func Io_write_analog(channel int, value int) {
	C.io_write_analog(C.int(channel), C.int(value))
}
示例#3
0
文件: io.go 项目: noekleby/TTK4145
func ioWriteAnalog(channel, value int) {
	C.io_write_analog(C.int(channel), C.int(value))
}
示例#4
0
func RunStop() {
	C.io_write_analog(C.MOTOR, 0)
}
示例#5
0
func RunDown() {
	C.io_set_bit(C.MOTORDIR)
	//time.Sleep(time.Second * 1)
	C.io_write_analog(C.MOTOR, 2800)
}
示例#6
0
func RunUp() {
	C.io_clear_bit(C.MOTORDIR)
	//time.Sleep(time.Second * 1)
	C.io_write_analog(C.MOTOR, 2800)
}
示例#7
0
func io_writeAnalog(channel, value int) {
	_, err := C.io_write_analog(C.int(channel), C.int(value))
	checkError(err)
}