Golang Taipei Gathering #15 - 進擊的 Gobot!

21
進擊的 Gobot! Attack on Gobot! kerkerj image from gobot.io

Transcript of Golang Taipei Gathering #15 - 進擊的 Gobot!

Page 1: Golang Taipei Gathering #15 - 進擊的 Gobot!

進擊的 Gobot!Attack on Gobot!kerkerj

image from gobot.io

Page 2: Golang Taipei Gathering #15 - 進擊的 Gobot!

Who am I

● kerkerj

● twitter: @kerkerj

● blog: blog.kerkerj.in (powered by hugo )

Page 3: Golang Taipei Gathering #15 - 進擊的 Gobot!

Today I’m going to share about

● Gobot● a little bit Arduino● Sphero

Page 4: Golang Taipei Gathering #15 - 進擊的 Gobot!

Gobot

Gobot is a framework for robotics, physical computing, and the Internet of Things, written in the Go programming language

Page 5: Golang Taipei Gathering #15 - 進擊的 Gobot!

Platforms

Page 6: Golang Taipei Gathering #15 - 進擊的 Gobot!

Drivers

Page 7: Golang Taipei Gathering #15 - 進擊的 Gobot!

And things I don’t know :P

Page 8: Golang Taipei Gathering #15 - 進擊的 Gobot!

Arduino

gort - To scan for connected devices, upload firmware, and more.

Page 9: Golang Taipei Gathering #15 - 進擊的 Gobot!
Page 10: Golang Taipei Gathering #15 - 進擊的 Gobot!

← My sensor is broken...Orz

NT$ 50

Page 11: Golang Taipei Gathering #15 - 進擊的 Gobot!

Arduino Blink using Gobot

Read the sample code, to understand how Gobot works.

$ vim ~/go/src/github.com/kerkerj/arduino_gobot/arduino.go

(or sample code from gobot.io)

read more:

● type Gobot● type Robot

Page 14: Golang Taipei Gathering #15 - 進擊的 Gobot!
Page 15: Golang Taipei Gathering #15 - 進擊的 Gobot!

Cats love it!

Maybe only my cat loves it …

Page 16: Golang Taipei Gathering #15 - 進擊的 Gobot!

What can Sphero do?

● Change light color● Rolling! Rolling! Rolling!● And Jump! (a little bit)

Page 17: Golang Taipei Gathering #15 - 進擊的 Gobot!

Official Gobot example for Sphero

Page 18: Golang Taipei Gathering #15 - 進擊的 Gobot!

In my demo

● I used Echo to create API endpoints to controll Sphero.○ Another micro web framework for Go.

● Use http request to set Sphero’s color or tell Sphero to roll...etc.

Page 19: Golang Taipei Gathering #15 - 進擊的 Gobot!

Sphero Demo

$ j gtg15

$ cd bin && ./sphero

$ open http://localhost:5566

Page 20: Golang Taipei Gathering #15 - 進擊的 Gobot!

End!

Demo project source: https://github.com/kerkerj/gtg15-demo

Page 21: Golang Taipei Gathering #15 - 進擊的 Gobot!

誠徵下次 gtg 講者 XD