Exemple #1
0
func FloorIndicator() {
	for {
		if elevdriver.GetFloor() > 0 {
			elevdriver.SetFloor(elevdriver.GetFloor())
		}
		time.Sleep(100 * time.Millisecond)
	}
}
Exemple #2
0
func turnAround() {
	for {
		floor := elevdriver.GetFloor()
		go elevdriver.SetFloor(floor)
		switch floor {
		case 1:
			go elevdriver.MotorUp()
		case 4:
			go elevdriver.MotorDown()
		}
	}
}