WEBVTT

00:00.000 --> 00:14.000
I love Bunny's personally and it seems to be a dual talk today.

00:14.000 --> 00:16.000
Who is this little friend?

00:16.000 --> 00:18.000
Who is this little friend?

00:18.000 --> 00:20.000
My daughter. My little assistant.

00:20.000 --> 00:22.000
Cold baller.

00:22.000 --> 00:24.000
Amazing.

00:24.000 --> 00:28.000
But it's two amazing speakers and tiny low.

00:32.000 --> 00:34.000
So today I'm going to talk about

00:34.000 --> 00:40.000
Plaging game with us our computer, our fan with Tiny Go.

00:40.000 --> 00:44.000
How many of you have cared about Tiny Go before?

00:44.000 --> 00:46.000
Please raise your hand.

00:46.000 --> 00:48.000
How many of you use Tiny Go before?

00:48.000 --> 00:50.000
Not that many.

00:50.000 --> 00:52.000
That's okay. Maybe that changed today.

00:52.000 --> 00:56.000
So what are you going to see today?

00:56.000 --> 00:58.000
I hope it's some fun to make project.

00:58.000 --> 01:00.000
This is nothing serious.

01:00.000 --> 01:04.000
Just get a little crazy with hardware and go.

01:04.000 --> 01:08.000
So Tiny Go is a project to bring the

01:08.000 --> 01:10.000
Go programming language to microcontroller.

01:10.000 --> 01:14.000
It's a compiler using LLBM.

01:14.000 --> 01:18.000
So you use your regular go code and we put it in a microcontroller

01:18.000 --> 01:24.000
like the RP-2040 or maybe an Arduino or microbit,

01:24.000 --> 01:28.000
ST micro, whatever you want.

01:28.000 --> 01:32.000
So whole game's work.

01:32.000 --> 01:34.000
First you have the any decision.

01:34.000 --> 01:40.000
And then in a loop you read the input of the player.

01:40.000 --> 01:44.000
You update the state of the game based on some

01:44.000 --> 01:48.000
rules and then you provide feedback to the player.

01:48.000 --> 01:52.000
And finally you terminate the game with a win, loss, or draw.

01:52.000 --> 01:56.000
So let's start simple.

01:56.000 --> 02:00.000
We are going to use the GoferBatch.

02:00.000 --> 02:06.000
It has an RP-2040, 133 maya health,

02:06.000 --> 02:20.000
and 264 kilobytes of RAM.

02:20.000 --> 02:24.000
To make a game or any program with Tiny GoFest,

02:24.000 --> 02:28.000
we need to import the matching package,

02:28.000 --> 02:34.000
which is a special package that allows you to talk directly with the hardware.

02:34.000 --> 02:38.000
You are using, in this case,

02:38.000 --> 02:42.000
like the pins, the LED, or any other sensor.

02:42.000 --> 02:46.000
Then for initially some phase,

02:46.000 --> 02:50.000
we are just going to configure the button,

02:50.000 --> 02:54.000
because we are going to use a button.

02:54.000 --> 03:00.000
In this example, we configure it as an input.

03:00.000 --> 03:04.000
Also, like the display, we need to start the display.

03:04.000 --> 03:08.000
In this case, it's an SPI protocol display.

03:08.000 --> 03:12.000
So just a very simple code.

03:12.000 --> 03:18.000
And then once inside in our game or in our code in the loop,

03:18.000 --> 03:24.000
we just read the state of the button, with this bait on a.get.

03:24.000 --> 03:28.000
For example, we just continue with the code,

03:28.000 --> 03:32.000
adding the rest of the rules of the game.

03:32.000 --> 03:36.000
And finally, we provide feedback to the player.

03:36.000 --> 03:38.000
For the feedback, Tiny GoFest,

03:38.000 --> 03:44.000
we try to make all the different screen supported by Tiny GoFest,

03:44.000 --> 03:48.000
try to use the display interface with a set of function,

03:48.000 --> 03:52.000
like set pixel, to change the color of a single pixel in the screen,

03:52.000 --> 03:56.000
field rectangle, like a whole rectangle in the screen,

03:56.000 --> 04:00.000
change the color, field rectangle with buffer, in case you want to use

04:00.000 --> 04:06.000
like complex image or different color for pixel,

04:06.000 --> 04:10.000
and field screen just change all the screen to one single color.

04:10.000 --> 04:14.000
On top of that, on the display interface,

04:14.000 --> 04:18.000
we have several other package, like Tiny GoFest,

04:18.000 --> 04:22.000
which allows you to draw different primitives,

04:22.000 --> 04:26.000
like a triangle or a SQL circle,

04:26.000 --> 04:30.000
and Tiny Phone that allows you to write text on the screen.

04:30.000 --> 04:34.000
So let's start simple,

04:34.000 --> 04:38.000
like I said with the GoFerBatch.

04:44.000 --> 04:48.000
This will be the code we are going to use,

04:48.000 --> 04:52.000
as I said, we are going to import the matching package,

04:52.000 --> 05:00.000
and also the ST7789 is the driver for the display.

05:00.000 --> 05:02.000
Oh, yeah.

05:08.000 --> 05:10.000
I don't know what to do.

05:10.000 --> 05:14.000
No.

05:14.000 --> 05:18.000
If you have trouble watching in the back,

05:18.000 --> 05:20.000
go to the fourth website, go to the GoFerBatch,

05:20.000 --> 05:22.000
follow it on your phone.

05:22.000 --> 05:24.000
We have technical issues.

05:24.000 --> 05:26.000
Oh, wow, it fixed itself.

05:26.000 --> 05:28.000
No, it's going.

05:28.000 --> 05:30.000
The first way.

05:32.000 --> 05:34.000
Sorry.

05:34.000 --> 05:36.000
Thank you.

05:38.000 --> 05:40.000
Any developers in the way?

05:40.000 --> 05:42.000
No.

05:42.000 --> 05:44.000
Don't let many developers in the way.

05:44.000 --> 05:46.000
Ah, okay.

05:52.000 --> 05:54.000
Okay, sorry.

05:54.000 --> 05:56.000
No worries.

05:56.000 --> 05:58.000
Again, the driver for the display,

05:58.000 --> 06:00.000
right there.

06:00.000 --> 06:03.000
The configuration for the SPI and the display.

06:03.000 --> 06:05.000
itself.

06:05.000 --> 06:07.000
Then the buttons, different buttons,

06:07.000 --> 06:09.000
but we are going to use very, very few.

06:09.000 --> 06:11.000
And then, oh, code is like,

06:11.000 --> 06:15.000
check if the left right up and down button is pressed,

06:15.000 --> 06:21.000
and then move like the X and Y variables,

06:21.000 --> 06:25.000
and then feel our rectangle at that coordinates.

06:27.000 --> 06:29.000
To run the code,

06:29.000 --> 06:31.000
to compile and flash the code,

06:31.000 --> 06:35.000
you just need to use the tiny Go command,

06:35.000 --> 06:37.000
tiny Go flash.

06:37.000 --> 06:39.000
Just specify your target.

06:39.000 --> 06:41.000
In this case, this is a GoFerBatch,

06:41.000 --> 06:43.000
and then your code.

06:53.000 --> 06:55.000
And we have this little square,

06:55.000 --> 06:58.000
if we press down or left,

06:58.000 --> 07:00.000
we can move it around the screen.

07:01.000 --> 07:03.000
Thank you.

07:15.000 --> 07:19.000
So, now time to do more complex themes.

07:21.000 --> 07:27.000
This is the tiny GoKip, zero, KYKBO2.

07:27.000 --> 07:31.000
It's made by Tagatagosan.

07:31.000 --> 07:35.000
It's a team member of Tiny Go.

07:35.000 --> 07:37.000
He made custom keyboards.

07:39.000 --> 07:45.000
That way, you can program it's key,

07:45.000 --> 07:51.000
and discuss the related button,

07:51.000 --> 07:53.000
and also adjust it.

07:53.000 --> 07:55.000
You can move your mouse.

07:55.000 --> 07:59.000
It works keyboard, regular one,

07:59.000 --> 08:03.000
but since you can program it with tiny Go,

08:03.000 --> 08:07.000
why not put games inside it?

08:11.000 --> 08:13.000
Let's see.

08:13.000 --> 08:17.000
For example, Flapigoffer.

08:17.000 --> 08:25.000
Sorry.

08:25.000 --> 08:29.000
So, how is that possible?

08:29.000 --> 08:33.000
Well, this game specifically is written with

08:33.000 --> 08:35.000
Koevitam.

08:35.000 --> 08:37.000
Koevitam is a game in giant.

08:37.000 --> 08:41.000
It was inspired in mini-tam and a bit in giant,

08:41.000 --> 08:45.000
which is made in giant also in Go.

08:45.000 --> 08:47.000
It offers flexibility,

08:47.000 --> 08:51.000
like you just go once and run everywhere.

08:51.000 --> 08:55.000
Koevitam and the tiny GoKip

08:55.000 --> 08:59.000
is the work of Masaki Tagatagosago.

08:59.000 --> 09:03.000
It's a tiny go for and part of the team.

09:03.000 --> 09:05.000
And again, if we follow the same formula,

09:05.000 --> 09:09.000
we just initialize, we set the hardware,

09:09.000 --> 09:13.000
the screen size,

09:13.000 --> 09:15.000
and then we start our new game.

09:19.000 --> 09:21.000
We just read the input.

09:21.000 --> 09:23.000
It offers several methods,

09:23.000 --> 09:25.000
like it's K-JAS press,

09:25.000 --> 09:27.000
or it's the K-JAS release.

09:29.000 --> 09:33.000
It provides basic J-Win fusion for primitive,

09:33.000 --> 09:35.000
like tiny and draw,

09:35.000 --> 09:37.000
and also for writing text.

09:37.000 --> 09:41.000
But also, you can embed

09:41.000 --> 09:47.000
and sprite a little image on your code.

09:47.000 --> 09:53.000
For example, you just, in this case,

09:53.000 --> 09:58.000
we are embedding the Gofer PNG file image,

09:58.000 --> 10:03.000
and then it's later sewn in the game.

10:03.000 --> 10:11.000
And as I said,

10:11.000 --> 10:17.000
it's just code once and run everywhere.

10:17.000 --> 10:19.000
Let's see, like,

10:19.000 --> 10:25.000
it's the same here.

10:25.000 --> 10:31.000
It's just the same code really in both hardware.

10:31.000 --> 10:35.000
Yeah.

10:35.000 --> 10:50.000
So, what's better than one Gofer?

10:50.000 --> 10:52.000
Two Gofer, let's go.

10:52.000 --> 10:55.000
Wait.

10:55.000 --> 11:00.000
In this case,

11:00.000 --> 11:04.000
I'm going to present the game link.

11:04.000 --> 11:08.000
The game link is this little device.

11:08.000 --> 11:12.000
It has an RP-2014 side.

11:12.000 --> 11:16.000
And that will allow us to communicate to different devices

11:16.000 --> 11:20.000
over the I-Q-C protocol.

11:20.000 --> 11:24.000
I-Q-C is a protocol to talk when integrated

11:24.000 --> 11:26.000
through with another.

11:26.000 --> 11:28.000
You use all the time to talk

11:28.000 --> 11:32.000
for example, from your microprocessor to the microprocessor

11:32.000 --> 11:35.000
of your sensor and way back.

11:35.000 --> 11:40.000
So, we just want to connect two of those keyboards.

11:40.000 --> 11:46.000
We are going to use another microprocessor inside the game link to do that.

11:46.000 --> 11:55.000
For listening to the I-Q-C communication,

11:55.000 --> 12:01.000
we configured the I-Q-C port just for listen.

12:01.000 --> 12:07.000
And then in our code, we just wait for the event,

12:07.000 --> 12:09.000
which the event could be like,

12:09.000 --> 12:11.000
receive information,

12:11.000 --> 12:18.000
or the keyboard could ask us to send it some information,

12:18.000 --> 12:22.000
or could it send the game link some information.

12:22.000 --> 12:30.000
The code inside the game link is very simple.

12:30.000 --> 12:36.000
It's just one stack with capacity of 10 message.

12:36.000 --> 12:40.000
So, one device send one or more message.

12:40.000 --> 12:46.000
It's a store and the other device could ask if there is any new message in the stack

12:46.000 --> 12:50.000
and retrieve it and remove it.

12:50.000 --> 12:56.000
Okay.

13:21.000 --> 13:27.000
Sorry, I'm connecting the thing.

13:44.000 --> 13:48.000
In this case, we can send like,

13:48.000 --> 13:52.000
there is nothing connected to the computer.

13:52.000 --> 13:56.000
Both of them are running the same code.

13:56.000 --> 14:00.000
One is going to host the game.

14:00.000 --> 14:16.000
One is going to host the game,

14:16.000 --> 14:20.000
and the other one is join the game.

14:20.000 --> 14:22.000
And then you press one,

14:22.000 --> 14:26.000
and you can play TikTok too, for example, here.

14:27.000 --> 14:29.000
You can see it is.

14:29.000 --> 14:32.000
And then one win and the other lose.

14:32.000 --> 14:34.000
Okay.

14:47.000 --> 14:52.000
This was a gift in case the previous example,

14:53.000 --> 14:55.000
Okay.

14:55.000 --> 14:58.000
This is like always true multiplayer,

14:58.000 --> 15:03.000
but what about like 21 century multiplayer?

15:03.000 --> 15:04.000
Of course.

15:04.000 --> 15:08.000
We feel Bluetooth and even Laura is supported by Tiny Go.

15:08.000 --> 15:11.000
You could watch any of Ron talk.

15:11.000 --> 15:13.000
Like, go with the wires.

15:13.000 --> 15:15.000
Go farther with the wire.

15:15.000 --> 15:17.000
Go even farther with the wires.

15:17.000 --> 15:19.000
Go with the wire, strikeback.

15:20.000 --> 15:25.000
Right to know if we go without wires in a few moments in this room today.

15:25.000 --> 15:29.000
And I know Fred of the maybe the next talk.

15:29.000 --> 15:31.000
They were awakens.

15:31.000 --> 15:36.000
I'm not sure.

15:36.000 --> 15:39.000
Other things you can't make.

15:39.000 --> 15:42.000
Tiny Go without a computer is, for example,

15:42.000 --> 15:45.000
Tiny Go has super for Game Boy at Bance,

15:45.000 --> 15:47.000
and even Nintendo Switch.

15:47.000 --> 15:53.000
We can agree that it's cool, but what is even cooler is free fly zero,

15:53.000 --> 15:55.000
which they have gone.

15:55.000 --> 16:00.000
They have annexed as time today at the KB limb.

16:00.000 --> 16:04.000
And they are going to make a talk tomorrow.

16:04.000 --> 16:07.000
A free fly zero is a console.

16:07.000 --> 16:12.000
That was wasn't forward console.

16:13.000 --> 16:16.000
So, you have several SDK.

16:16.000 --> 16:21.000
In this case, they have the go SDK.

16:21.000 --> 16:25.000
With the fly fly command tools and tooling,

16:25.000 --> 16:28.000
you code in Go using the SDK.

16:28.000 --> 16:32.000
They use internally Tiny Go to compile it to our file,

16:32.000 --> 16:36.000
and then the fly zero can execute the game,

16:36.000 --> 16:39.000
and then you're happy to offer.

16:40.000 --> 16:45.000
So, following the example, again, the formula,

16:45.000 --> 16:51.000
that's in it in the fly fly fly fly.

16:51.000 --> 16:56.000
SDK, we have to define a boot function,

16:56.000 --> 16:59.000
which will run at the beginning.

16:59.000 --> 17:02.000
We are going to define an update function,

17:02.000 --> 17:04.000
which is our loop or back home,

17:04.000 --> 17:06.000
and I run the function,

17:06.000 --> 17:10.000
which is that manage how it will bring on the stream.

17:14.000 --> 17:16.000
Unfortunately, I don't have any prototype,

17:16.000 --> 17:19.000
because they only have prototype as the estate,

17:19.000 --> 17:22.000
but as I said, the tooling is really good,

17:22.000 --> 17:25.000
and they have an emulator.

17:32.000 --> 17:33.000
So,

17:37.000 --> 17:39.000
this will be, again, another example,

17:39.000 --> 17:42.000
there is very, very simple in the emulator.

17:42.000 --> 17:44.000
We just define the previous function I talk

17:44.000 --> 17:45.000
in the boot function.

17:45.000 --> 17:49.000
I just load an image of a gover.

17:49.000 --> 17:53.000
I load a phone to be able to break text.

17:53.000 --> 17:57.000
And in the, you put the function,

17:57.000 --> 17:59.000
we just wait to put of the player,

17:59.000 --> 18:02.000
and move to the coordinate.

18:02.000 --> 18:03.000
And in the render function,

18:03.000 --> 18:07.000
we just clear the string, draw the image,

18:07.000 --> 18:09.000
and draw the text.

18:20.000 --> 18:23.000
In this case, let me point it.

18:33.000 --> 18:40.000
We can run the emulator.

18:46.000 --> 18:49.000
We are going to test this one,

18:49.000 --> 18:52.000
and then just as I move.

18:52.000 --> 18:55.000
The cursor, it's moved.

18:55.000 --> 18:58.000
So, it's using tiny go to compile your go code

18:59.000 --> 19:00.000
into a version.

19:00.000 --> 19:04.000
And then, like in the previous talk,

19:04.000 --> 19:06.000
if you were able to watch it,

19:06.000 --> 19:11.000
it's running the ones fill the file in the emulator.

19:13.000 --> 19:17.000
This is one of the game running on the prototype,

19:17.000 --> 19:20.000
as I said, what will,

19:20.000 --> 19:25.000
they have like a growing catalog of different games.

19:26.000 --> 19:29.000
And it has already super for multiplayer,

19:29.000 --> 19:31.000
for batch, for electronics,

19:31.000 --> 19:34.000
debugging, image, phone,

19:34.000 --> 19:36.000
the tooling is super good.

19:36.000 --> 19:39.000
The documentation is also super good.

19:39.000 --> 19:41.000
They have a stand at first,

19:41.000 --> 19:42.000
and in the KVL,

19:42.000 --> 19:46.000
and they will be talked tomorrow about them.

19:46.000 --> 19:53.000
So, you could go crazy and create your own hardware.

19:54.000 --> 19:57.000
Tiny go, super more than 85 boards,

19:57.000 --> 20:00.000
more than 100 of different devices,

20:00.000 --> 20:04.000
like sensor, actuator, displays.

20:04.000 --> 20:07.000
In this example, I saw here,

20:07.000 --> 20:09.000
I didn't bring in with me,

20:09.000 --> 20:12.000
but you will see some image of it working.

20:12.000 --> 20:16.000
It's just one LED strip,

20:16.000 --> 20:19.000
and one MacNet term,

20:19.000 --> 20:22.000
it's tell where the MacNet is.

20:22.000 --> 20:25.000
And then you use your imagination.

20:26.000 --> 20:30.000
The input of the game is very simple,

20:30.000 --> 20:32.000
just...

20:33.000 --> 20:36.000
Oops.

20:50.000 --> 20:54.000
And you could also go minimalistic.

20:54.000 --> 20:58.000
You can use even your name tag for it.

21:03.000 --> 21:06.000
This is the name tag,

21:06.000 --> 21:08.000
much talk earlier.

21:08.000 --> 21:10.000
It's running, go code,

21:10.000 --> 21:13.000
it's running on an 80 tiny,

21:13.000 --> 21:15.000
1616.

21:15.000 --> 21:17.000
Here is the information.

21:17.000 --> 21:19.000
8-bit microcontroller,

21:19.000 --> 21:21.000
20 mayor health,

21:21.000 --> 21:24.000
and only 16 kilobyte of RAM.

21:27.000 --> 21:29.000
So, it's very small,

21:29.000 --> 21:31.000
really small.

21:33.000 --> 21:36.000
You need to use your imagination, okay?

21:38.000 --> 21:43.000
We are going to assume the green LED is the hero,

21:43.000 --> 21:45.000
and the red one is the enemy,

21:45.000 --> 21:48.000
and you just need to reach the castle,

21:48.000 --> 21:50.000
which is the yellow one.

21:50.000 --> 21:53.000
In this case, the LEDs are in a matrix,

21:53.000 --> 21:55.000
it's not an LED strip,

21:55.000 --> 21:58.000
so it's a little bit more complicated to manage them,

21:59.000 --> 22:01.000
but once you get everything shot out,

22:01.000 --> 22:03.000
it's easy.

22:22.000 --> 22:24.000
Let me flush it real quick.

22:28.000 --> 22:31.000
Okay?

22:39.000 --> 22:41.000
And then we have our game.

22:42.000 --> 22:58.000
If you don't have any hardware at hand,

22:58.000 --> 23:01.000
I suggest you buy right now a lot.

23:01.000 --> 23:03.000
But if not,

23:03.000 --> 23:06.000
you can use the tiny low playground.

23:06.000 --> 23:10.000
It has several types of hardware emulation.

23:11.000 --> 23:13.000
You can run your code,

23:13.000 --> 23:14.000
and it will be,

23:14.000 --> 23:16.000
you will see the visual representation.

23:16.000 --> 23:19.000
We had a stand today,

23:19.000 --> 23:21.000
and tomorrow too,

23:21.000 --> 23:23.000
at Fox News,

23:23.000 --> 23:26.000
the AEW building

23:26.000 --> 23:29.000
between open remote and genome,

23:29.000 --> 23:32.000
and the link for everything in the talk.

23:32.000 --> 23:33.000
Thank you.

23:33.000 --> 23:37.000
Wow, again, wow.

