Пример #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
func Io_write_analog(channel int, value int) {
	C.io_write_analog(C.int(channel), C.int(value))
}
Пример #3
0
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)
}