Пример #1
0
func (elevinf *Elevatorinfo) Initiate() {
	fmt.Printf("Halla\n")
	elevdriver.Init()
	fmt.Printf("Balle\n")
	StartMotor(-1)
	elevinf.last_direction = 2
	for elevdriver.GetFloor() == -1 {
	}

	elevinf.StopMotor()

	fmt.Printf("Elevator initiation complete!\n")
}
Пример #2
0
func main() {
	elevdriver.Init()
	fmt.Printf("Started!\n")
	go readButtons()
	go turnAround()
	go watchObs()
	time.Sleep(1 * time.Second)
	elevdriver.MotorUp()
	for {
		select {
		case <-time.After(1 * time.Second):
		}
	}
}