Build real-world gaming hardware with TinyGo
This is a modal window.
Das Video konnte nicht geladen werden, da entweder ein Server- oder Netzwerkfehler auftrat oder das Format nicht unterstützt wird.
Formale Metadaten
Titel |
| |
Untertitel |
| |
Serientitel | ||
Anzahl der Teile | 490 | |
Autor | ||
Lizenz | CC-Namensnennung 2.0 Belgien: Sie dürfen das Werk bzw. den Inhalt zu jedem legalen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen. | |
Identifikatoren | 10.5446/47297 (DOI) | |
Herausgeber | ||
Erscheinungsjahr | ||
Sprache |
Inhaltliche Metadaten
Fachgebiet | ||
Genre | ||
Abstract |
|
00:00
MenütechnikHypermediaGebäude <Mathematik>HardwareTermÜbersetzer <Informatik>Formale SpracheProgrammierungCompilerBrowserWhiteboardProgrammReelle ZahlEEPROMQuellcodePlastikkarteKomponente <Software>DruckverlaufAbstandRestklasseFolge <Mathematik>CodeFolge <Mathematik>DatensichtgerätProjektive EbeneSpieltheorieGraphfärbungUnrundheitTeilmengeVersionsverwaltungDifferenteMultiplikationsoperatorVerschlingungInformationRechenschieberCompilerHyperbelverfahrenProgrammierungMereologieGrenzschichtablösungGebäude <Mathematik>EchtzeitsystemHardwareComputerMikrocontroller
04:15
MenütechnikCodeKomponente <Software>Schreiben <Datenverarbeitung>KommensurabilitätÜbersetzer <Informatik>ATMWhiteboardWhiteboardFunktion <Mathematik>NormalvektorCodeDifferenteTreiber <Programm>Persönliche IdentifikationsnummerHardwareFunktionalComputerVirtuelle MaschineComputeranimation
07:21
AggregatzustandCodeArithmetischer AusdruckMultiplikationsoperatorFlash-SpeicherComputeranimation
08:08
ProgrammierungComputeranimation
08:58
Komponente <Software>SpieltheorieTouchscreenMenütechnikMatrizenrechnungCodeLesen <Datenverarbeitung>AnalogieschlussPixelMathematikDatensichtgerätATMWhiteboardSampler <Musikinstrument>Konvexe HülleSpielkonsoleInklusion <Mathematik>AnalogieschlussInterface <Schaltung>NormalvektorTouchscreenCodeBootenMobiles EndgerätSerielle SchnittstellePixelPeripheres GerätEchtzeitsystemGraphfärbungKonfigurationsraumUmsetzung <Informatik>Persönliche IdentifikationsnummerGanze ZahlTreiber <Programm>SpieltheorieDatensichtgerätSpielkonsoleInternet der DingeVirtuelle MaschineMatrizenrechnungEndliche ModelltheorieFlash-SpeicherElementargeometrieEin-AusgabeKonfiguration <Informatik>Mereologie
12:42
Stapeldatei
13:23
SpieltheorieMobiles EndgerätSpielkonsoleKonfiguration <Informatik>Komponente <Software>DatensichtgerätSpieltheorieStapeldateiKonfiguration <Informatik>Computeranimation
14:09
BinärdatenCodeSpieltheorie
14:53
Strom <Mathematik>FontRoboterProgrammQuellcodeProgrammierungMenütechnikMarketinginformationssystemTrägheitsmomentKonvexe HülleNormierter RaumÜbersetzer <Informatik>GrenzschichtablösungDifferenteDualitätstheorieGruppenoperationOffene MengeRobotikPuffer <Netzplantechnik>Projektive EbeneMikrocontrollerHydrostatischer AntriebAdditionCodeTreiber <Programm>Open SourceTouchscreenProgrammierungHardwareComputeranimation
17:52
Puffer <Netzplantechnik>Computeranimation
18:31
Offene MengeCodeWhiteboardBitrateATMSimulationSampler <Musikinstrument>Weg <Topologie>Ein-AusgabeInternet der DingeFunktion <Mathematik>KontrollstrukturTurbo-CodeKonditionszahlAdressraumMikrocontrollerProjektive EbeneWeg <Topologie>InformationsspeicherungPersönliche Identifikationsnummersinc-FunktionDifferenteOffene MengeGraphfärbungHardwareEin-AusgabeComputeranimation
21:50
MomentenproblemComputeranimation
22:52
Offene MengeMenütechnikQuellcodeVerschlingungBitrateFehlermeldungDigitaltechnikElektronische PublikationProjektive EbeneComputeranimation
23:57
FacebookOpen SourcePunktwolke
Transkript: Englisch(automatisch erzeugt)
00:14
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.
00:23
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.
00:42
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
01:04
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.
01:23
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.
01:40
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.
02:02
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,
02:24
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,
02:43
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?
03:01
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.
03:23
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.
03:42
And it will be going a longer sequence each time. For the Simon, it's very simple.
04:04
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.
04:27
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.
04:41
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,
05:05
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
05:25
to disable it. For the three buttons, it's very similar also.
05:41
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,
06:05
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
06:22
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.
06:41
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.
07:03
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
07:23
is press enter the programmable state. And then it's, I'm sorry.
07:41
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
08:02
and the code you are going to flash. We wait out detail. It has a battery, so.
08:29
And now we have our Go program here. It will play and it will go longer and longer.
08:48
It's for the next one.
09:03
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,
09:20
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
09:42
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.
10:01
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
10:21
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.
10:45
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.
11:02
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.
11:24
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.
11:50
Again, you write the rest of the code, you put it in boot log model and flash it. And there you have it, here.
12:10
For the real-time clock, again, in this instead of SPI interface and I2C, we configure it and we just use like,
12:21
you will see, I mean, you are seeing that this is normal Go code. For third project, we could make portable game console.
12:42
You have some option. This is, we are also using this as batch.
13:10
It's a little blurry, sorry.
13:28
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
13:40
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.
14:00
Of course, if you want something more professional looking, you could use a Game Boy Advance because actually, it's right.
14:24
We just compile a Go code and it's running on a Game Boy Advance. I cannot tell you exactly how you should put
14:40
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
15:04
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.
15:28
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.
15:44
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.
16:01
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,
16:22
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.
16:45
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.
17:04
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.
17:21
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.
17:48
Again, we flash the code and see in action. In this case, it's a little buffer.
18:00
So we just tell them to go forward, turn right, and then come back, and it's moving.
18:44
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,
19:03
and then make the different LED move. You simulate a race with any input. For this, you need an addressable LED strip,
19:20
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
19:44
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,
20:05
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
20:20
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
20:43
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
21:00
and have telemetry data like the professional. And if the Wi-Fi works, you are going to be
21:45
the red golfer, you are going to be, wait.
22:04
Okay, wait a moment.
22:26
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.
22:41
Yes, and for both of you, this Arduino Nano
23:08
is compatible and you could make this. So, as I said, everything is here. Everything is here, all the projects just here
23:26
are working and are on GitHub right now. And if you just like, join us at TinyGo channel of Slack. Thank you.