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") }
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): } } }