示例#1
0
文件: main.go 项目: stianlaa/SLH2016
func init() {
	driver.ElevInit()
	driver.ElevSetMotorDirection(1)

	for {
		if driver.ElevGetFloorSensorSignal() >= 0 {
			driver.ElevSetMotorDirection(0)
			break
		}
	}
}
示例#2
0
func main() {
	Driver.ElevInit()
	localStatusCh := make(chan Elev_control.Elevator, 10)
	sendBtnCallCh := make(chan [NUMBUTTONS - 1]int, 10)
	errorCh := make(chan int)
	receiveAllBtnCallsCh := make(chan [NUMFLOORS][NUMBUTTONS - 1]bool, 10)
	setLights_setExtBtnsCh := make(chan [4][2]bool, 10)

	go Elev_control.Run_Elevator(localStatusCh, sendBtnCallCh, receiveAllBtnCallsCh, setLights_setExtBtnsCh, errorCh)
	go Master_Slave.Run_MasterSlave_Logic(localStatusCh, sendBtnCallCh, receiveAllBtnCallsCh, setLights_setExtBtnsCh, errorCh)
	checkForError(errorCh)
	callBackup := exec.Command("gnome-terminal", "-x", "sh", "-c", "go run main.go")
	callBackup.Run()
}
示例#3
0
文件: main.go 项目: borgewi/SLH2016
func initMain() {
	driver.ElevInit()
	driver.ElevSetMotorDirection(1)
	var previousFloor = -1

	for {
		if driver.ElevGetFloorSensorSignal() >= 0 {
			driver.ElevSetMotorDirection(0)
			previousFloor = driver.ElevGetFloorSensorSignal()
			fmt.Println("I've reached floor", previousFloor)
			break
		}
	}
}
示例#4
0
func main() {
	driver.ElevInit()
	driver.ElevSetMotorDirection(0)
}