예제 #1
0
파일: sample.go 프로젝트: rwaldron/GoEV3
func testTTSAndButtons() {
	TTS.Speak("Hello! Press the following sequence of buttons:")

	fmt.Println("Press the following sequence of buttons:")
	fmt.Println("left, right, up, down, enter")

	Button.Wait(Button.Left)
	Button.Wait(Button.Right)
	Button.Wait(Button.Up)
	Button.Wait(Button.Down)
	Button.Wait(Button.Enter)
}
예제 #2
0
파일: sample.go 프로젝트: rwaldron/GoEV3
func testMotors() {
	fmt.Println("Make sure there is a motor plugged in to port A and press the center button to continue.")
	Button.Wait(Button.Enter)

	fmt.Println("Running motor A")
	Motor.Run(Motor.OutPortA, 40)

	for n := 0; n < 20; n++ {
		time.Sleep(time.Second / 2)

		fmt.Printf("Running motor A with speed %d and power %d\n", Motor.CurrentSpeed(Motor.OutPortA), Motor.CurrentPower(Motor.OutPortA))
	}

	Motor.Stop(Motor.OutPortA)
}