We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Build real-world gaming hardware with TinyGo

00:00

Formal Metadata

Title
Build real-world gaming hardware with TinyGo
Subtitle
Make toys and other contraptions that run on Go
Title of Series
Number of Parts
490
Author
License
CC Attribution 2.0 Belgium:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
Learn the multiples and fun possibilities of using Go on microcontrollers like Arduino to make gaming related hardware. After a brief overview of the new features of TinyGo (http://tinygo.org), we'll move onto some cool and easy to make smart-toys that run Go. From classic PONG and a "Simon says" device to a pocket gaming console, and some other surprises. We'll end with an Open LED Race competition and the possibility to win hardware and make your our TinyGo device. This talk will feature bright lights and sounds, maybe lasers too.
33
35
Thumbnail
23:38
52
Thumbnail
30:38
53
Thumbnail
16:18
65
71
Thumbnail
14:24
72
Thumbnail
18:02
75
Thumbnail
19:35
101
Thumbnail
12:59
106
123
Thumbnail
25:58
146
Thumbnail
47:36
157
Thumbnail
51:32
166
172
Thumbnail
22:49
182
Thumbnail
25:44
186
Thumbnail
40:18
190
195
225
Thumbnail
23:41
273
281
284
Thumbnail
09:08
285
289
Thumbnail
26:03
290
297
Thumbnail
19:29
328
Thumbnail
24:11
379
Thumbnail
20:10
385
Thumbnail
28:37
393
Thumbnail
09:10
430
438
Menu (computing)HypermediaBuildingComputer hardwareTerm (mathematics)CompilerFormal languageComputer programmingCompilerWeb browserWhiteboardComputer programReal numberEEPROMSource codePlastikkarteComponent-based software engineeringPressureDistanceModulo (jargon)SequenceCodeSequenceElectronic visual displayProjective planeGame theoryGraph coloringRoundness (object)SubsetRevision controlDifferent (Kate Ryan album)Multiplication signLink (knot theory)InformationSlide ruleCompilerMultilaterationComputer programmingMereologyFlow separationBuildingReal-time operating systemComputer hardwareComputerMicrocontroller
Menu (computing)CodeComponent-based software engineeringWritingThomas KuhnCompilerAsynchronous Transfer ModeWhiteboardWhiteboardFunction (mathematics)Normal (geometry)CodeDifferent (Kate Ryan album)Device driverPersonal identification numberComputer hardwareFunctional (mathematics)ComputerVirtual machineComputer animation
State of matterCodeExpressionMultiplication signFlash memoryComputer animation
Computer programmingComputer animation
Component-based software engineeringGame theoryTouchscreenMenu (computing)Matrix (mathematics)CodeReading (process)AnalogyPixelMathematicsElectronic visual displayAsynchronous Transfer ModeWhiteboardCompilation albumConvex hullVideo game consoleInclusion mapAnalogyInterface (computing)Normal (geometry)TouchscreenCodeBootingPortable communications deviceSerial portPixelPeripheralReal-time operating systemGraph coloringConfiguration spaceData conversionPersonal identification numberIntegerDevice driverGame theoryElectronic visual displayVideo game consoleInternet der DingeVirtual machineMatrix (mathematics)Endliche ModelltheorieFlash memoryGeometryoutputComputer configurationMereology
Stapeldatei
Game theoryPortable communications deviceVideo game consoleComputer configurationComponent-based software engineeringElectronic visual displayGame theoryStapeldateiComputer configurationComputer animation
Binary fileCodeGame theory
Electric currentComputer fontRobotComputer programSource codeComputer programmingMenu (computing)MaizeMoment of inertiaConvex hullNormed vector spaceCompilerFlow separationDifferent (Kate Ryan album)Duality (mathematics)Group actionOpen setRoboticsBuffer solutionProjective planeMicrocontrollerHydraulic motorAdditionCodeDevice driverOpen sourceTouchscreenComputer programmingComputer hardwareComputer animation
Buffer solutionComputer animation
Open setCodeWhiteboardBit rateAsynchronous Transfer ModeSimulationCompilation albumTrailoutputInternet der DingeFunction (mathematics)Control flowTurbo-CodeCondition numberAddress spaceMicrocontrollerProjective planeTrailData storage devicePersonal identification numberSinc functionDifferent (Kate Ryan album)Open setGraph coloringComputer hardwareoutputComputer animation
Moment (mathematics)Computer animation
Open setMenu (computing)Source codeLink (knot theory)Bit rateError messageDigital electronicsComputer fileProjective planeComputer animation
FacebookOpen sourcePoint cloud
Transcript: English(auto-generated)
Cool, so it's 10.30, so we can start. OK, so next up we have Daniel who's going to be talking about TinyGo and how to build toys with TinyGo and lots of hardware.
So round of applause for him, please. Hello, I'm Daniel Esteban, also known as Conejo. And I will talk today about building toys or games, devices, with TinyGo.
And a maker is like, I make things on my free time, usually involving electronics. And maybe you are asking, what is TinyGo? TinyGo is not a subset or a superset of Go. It's the same language. It's just a new compiler that targets a very, very
small place. We released version 0.12 two days ago. If you want to know more about TinyGo, you could check the link there about the last year at Fosden, also talk from Ron Evan.
And no, we are sponsored by Google. When I talk about small places, I talk about this kind of microcontroller. They are really small. Maybe you should see this, some of you.
But it's like Arduino, BBC Microbit, some of the Adafrid, like Itsy Bitsy or Secret Playground Express. TinyGo also compiles your Go program to smartwatches, like the Pine Time.
Just go to the AW building and check the Pine64 booth stand they have there. We have support for several other devices, sensors, and actuators, like RGB LEDs, real-time clock, humidity,
temperature sensor, sound, light sensor, distance, a lot of things. And also, a lot of displays. If you don't have any bar or jet or you don't have any devices to play,
we also have Playground. We simulate some of the bar, and you could try TinyGo without installing anything on your computer. So what are you going to see today?
Well, some small toys, some fun-to-make projects that you could do at home. All the information is on the slide I will upload later. I will just go over the highlights or the main different parts that you need, the basic you need to make this project.
So the first one is the Go First Day. I don't know if you know this game is called Simon. Sometimes it plays a different tone and lights a different color, and you need to match that color.
And it will be going a longer sequence each time. For the Simon, it's very simple.
We'll only use three buttons and three LED and some printed bar. And I will just use an Adafruit Playground Express, which is this little bar.
Our Go code, we start with the import. We just need to import the main package, the machine package, which is a special one to talk to the hardware.
And we also are going to import like tinygo.rx driver busser, which is to make sound. To set up the LED, we just define an LED like mhin.a1 or a2 or maybe d12,
because it's the pin number on your board. We configure it as an output pin here. And to enable the LED, it's as simple as LED.high or LED.low
to disable it. For the three buttons, it's very similar also.
But instead of output, we configure them as an input. And just to check the status of the button, is it pressed or not? Yes, we do button.get. And it will return true, false. For the busser, which is a small speaker that makes sound,
again, we define the busser pin. We configure it as an output. And then we create a busser device. And to play a song, it's as simple
as just call the function tone with a note and a duration of that note. The rest of the code is your normal Go code.
There is no difference there. And since it's a bit longer than I wanted to, I will not show. But it's already in the slide and in the tab to check it. But you will check it's the same. It's the same as Go and it's no difference.
To flash it on your board, so it's program, you usually just connect it to your computer and normally you double press the rest of the buttons. So it's your, in this case, the secret playground
is press enter the programmable state. And then it's, I'm sorry.
And I don't know how to change it now. I could make bigger. So to flash it is just as simple as timing Go flash. You just specify your target. In this case, the secret play express
and the code you are going to flash. We wait out detail. It has a battery, so.
And now we have our Go program here. It will play and it will go longer and longer.
It's for the next one.
I don't know, probably you know the game called Pong. It's sometimes a hockey game. We just need a display. This one is not so tiny. It's a little big. Actually this is one like,
you could put one several together and make those big billboard on the street or in the stadium. It's supported by TinyGo. And also for this case, I just add a real time clock. So actually the game is playing itself
while showing the hour and when it's time, one player or the other will lose. For the game, we just need two percent geometers. I use them as knob here.
They are analog input. We also use that huge LED matrix. And in this case, I choose an Arduino Nano 33 IoT. And as I said, a real time clock optional. Again, the import part is you just need
to import the machine package. The driver for the HUB-75, which is the LED matrix. The driver for the real time clock. And the tiny phone package, which is a special package also that allow us to draw text on every TinyGo display supported.
For the analog input, it's very similar as the bottom of the previous example. In this case, we need to initialize the analog to digital converter. But the thing is, we just choose a pin and configure it.
And instead of true, false, now we are getting an integer variable depending on the value of the analog for the screen. Also, quite simple, we define a serial peripheral interface, SPI interface for the screen.
And we create a HUB-75, which is the screen device. We make some configuration of the displays, but then we just call, like we could change each pixel with set pixel. Just the X, Y coordinates and the color.
Again, you write the rest of the code, you put it in boot log model and flash it. And there you have it, here.
For the real-time clock, again, in this instead of SPI interface and I2C, we configure it and we just use like,
you will see, I mean, you are seeing that this is normal Go code. For third project, we could make portable game console.
You have some option. This is, we are also using this as batch.
It's a little blurry, sorry.
Yeah, I put the GIF there, it goes better. You have several options here. You could make a homemade one with a spare part you have
or you could buy us, there are some more like this. This is a Pi batch, but there are also pay gammer or each batch. Like more or less, as long as it has an display and some buttons, you could make your own games.
Of course, if you want something more professional looking, you could use a Game Boy Advance because actually, it's right.
We just compile a Go code and it's running on a Game Boy Advance. I cannot tell you exactly how you should put
your binary files there. Maybe it's not really legal, but, and for your games, you could use Tiny Draw. It's a package to make simple primitive
on every screen that is supported by Tiny Go right now. We also have Tiny Phone, which is to write text on the displays also.
The last two projects, I like a lot. They are community projects. They are also open source and open hardware. The first one is called Scornabot, which means beetles.
It's an educational robot similar to a Bebot or a Cubetto and it's great. And I mean, it's being used in a school right now to introduce young children into programming.
Children are not programming the robot itself, but they are just using the top buttons here to make the robot move or turn. It doesn't that much. Just you, the children click the button,
like move forward one step or two step, then turn right, then go backward. As I said, it's being used in a school. If it's not the Scornabot, it's usually the Bebot or Cubetto. They have several different activities with them.
For the robot, you just, the most important is you just need two stepper motor, five buttons, one buffer to make sound, which is optional, some 3D printed bar, and microcontroller.
The different, I mean, we already see how to use the button and the only addition to this project is the use of two motors with the easy stepper driver.
In this case, if you have one motor, it's just create a new easy stepper device, just configure and just tell the motor to move 200 step. But we have two, so instead we use easy stepper new dual device and just tell them move.
Again, we flash the code and see in action. In this case, it's a little buffer.
So we just tell them to go forward, turn right, and then come back, and it's moving.
The last project is possibly my favorite. It's called Open LED Race. It's also a community project. It's open store and open hardware. You just create a race track with LED strip,
and then make the different LED move. You simulate a race with any input. For this, you need an addressable LED strip,
anything as an input, and just a microcontroller. The only difference here is the WS2812, which is the LED strip. Just select the pin for the output, create a new device, and you just write the color
you want to appear on the LED strip. I will need two volunteers that want to compete in the game, and just win some hardware we have to give away. So if you know how to click a button, please,
raise your hand. Just check, both of you, okay. Again, since it's an open hardware project and community-driven, I said you could use
anything as an input. So people is doing different kind of things. We just simulate the track. In this case, on the left picture, we simulate the gravity, so we are creating a virtual slope that will slow your car
on one side and speed it up on the other. Also, in this case, Arduino Nano has a Wi-Fi chip, so why not add Wi-Fi to your project
and have telemetry data like the professional. And if the Wi-Fi works, you are going to be
the red golfer, you are going to be, wait.
Okay, wait a moment.
Okay, it's too much. Yeah, wait. I don't know if it will be working, but we'll see. Just, oh, it's not working, but press the button.
Yes, and for both of you, this Arduino Nano
is compatible and you could make this. So, as I said, everything is here. Everything is here, all the projects just here
are working and are on GitHub right now. And if you just like, join us at TinyGo channel of Slack. Thank you.