Пример #1
0
	Use:   "furbyBot",
	Short: "Primary command for project - set up gobot Furby interaction",
	Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:

Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("furbyBot called")

		gbot := gobot.NewGobot()
		api.NewAPI(gbot).Start()

		r := raspi.NewRaspiAdaptor("raspi")
		audioAdaptor := audio.NewAudioAdaptor("sound")
		jenkinsAdaptor := jenkinsconnect.NewJenkinsconnectAdaptor("jenkins")

		// Set up asynchronous channel - if we get more than 3 sounds being played in a row, something's up
		csoundFiles := make(chan string, 3)
		furby := furby.NewFurbyDriver(r, "furby", "16", csoundFiles)
		audioDriver := audio.NewAudioDriver(audioAdaptor, "sounds", csoundFiles)
		jenkinsDriver := jenkinsconnect.NewJenkinsconnectDriver(jenkinsAdaptor, "jenkins-command")

		screen := i2c.NewGroveLcdDriver(r, "screen")
		work := func() {

			screen.Clear()
			screen.Home()
			furby.On()
func initTestInfrastructure() {
	queue := make(chan string, 1)
	d = initTestFurbyDriver(newGpioTestAdaptor("adaptor"), queue)
	a := audio.NewAudioDriver(audio.NewAudioAdaptor("conn"), "dev", queue)
	a.Start()
}