Ejemplo n.º 1
0
func flash_led(d *freenect.FreenectDevice, led string) {
	switch {
	case led == "off":
		d.SetLed(freenect.LED_OFF)
		break
	case led == "green":
		d.SetLed(freenect.LED_GREEN)
		break
	case led == "red":
		d.SetLed(freenect.LED_RED)
		break
	case led == "yellow":
		d.SetLed(freenect.LED_YELLOW)
		break
	case led == "blink_yellow":
		d.SetLed(freenect.LED_BLINK_YELLOW)
		break
	case led == "blink_green":
		d.SetLed(freenect.LED_BLINK_GREEN)
		break
	case led == "blink_red_yellow":
		d.SetLed(freenect.LED_BLINK_RED_YELLOW)
		break
	}
}
Ejemplo n.º 2
0
func DoLed(d *freenect.FreenectDevice) {
	fmt.Println("Changing LED status")
	fmt.Println("\tOFF")
	d.SetLed(freenect.LED_OFF)
	time.Sleep(1000000000)
	fmt.Println("\tGREEN")
	d.SetLed(freenect.LED_GREEN)
	time.Sleep(1000000000)
	fmt.Println("\tRED")
	d.SetLed(freenect.LED_RED)
	time.Sleep(1000000000)
	fmt.Println("\tYELLOW")
	d.SetLed(freenect.LED_YELLOW)
	time.Sleep(1000000000)
	fmt.Println("\tBLINK YELLOW")
	d.SetLed(freenect.LED_BLINK_YELLOW)
	time.Sleep(3000000000)
	fmt.Println("\tBLINK_GREEN")
	d.SetLed(freenect.LED_BLINK_GREEN)
	time.Sleep(3000000000)
	fmt.Println("\tBLINK RED/YELLOW")
	d.SetLed(freenect.LED_BLINK_RED_YELLOW)
	time.Sleep(3000000000)
	fmt.Println("\tOFF")
	d.SetLed(freenect.LED_OFF)
}