Check out a free preview of the full Nodebots / Hardware course:
The "Introduction" Lesson is part of the full, Nodebots / Hardware course featured in this preview video. Here's what you'd learn in this lesson:

Steve Kinney provides an overview of the course, which is about building robots with Node.js. Steve reviews the hardware package needed for the course, Johnny-Five Inventor's Kit.

Get Unlimited Access Now

Transcript from the "Introduction" Lesson

>> Steve Kinney: Hello, my name is Steve, and we're gonna play with some hardware today, it's gonna be fun. This is Introduction to Nodebots. I guess we should answer the obvious question is is, what are Nodebots? Unfortunately, the answer is not particularly illuminating. It's robots with node.js. It's a lot more catchy than JavaScript bots, and it rolls off the tongue a lot better.

[00:00:26] So the kit that we're gonna be using is the Johnny-Five Inventor's Kit. And we'll talk about what Johnny-Five is in a second. But this is kind of the spread. It's in a nice, little, neat box, but if you were to spread it out across the table, this is roughly what it looks like.

[00:00:42] And the kind of important piece here is the actual, [INAUDIBLE] you have what is called a Tessel 2. Which is a open source piece of hardware that runs JavaScript natively. Which is really cool, cuz it means that we can program using JavaScript. That's okay, that's fine, right? If we really wanted to, we could learn some other language.

[00:01:02] I choose not to learn other languages. I choose to [LAUGH] exclusively just write JavaScript. But the major thing that I'm going to keep kind of hitting on throughout the day is what's really cool about programming hardware with JavaScript is not just I get to use my favorite my language which is nice.

[00:01:22] But that we're still using the same technologies that we used to create web servers and browser-based experiences, and that we can bring all of those together. We can use any library on NPM. We can use the browser and any of the APIs on the browser, and mix and match all those things together.

[00:01:39] And I think that's what makes working with hardware with JavaScript really exciting. So that Tessel 2 that you have, we're gonna set it up in a second. First, I kinda wanna take just a little tour of what it is. So this is what it looks like, you have one in front of you so this is I guess helpful to see on the screen, but this is the board itself.

[00:02:00] It's actually really cool. So it's got two USB ports, an Ethernet port, it's actually got built in WiFi and you can actually deploy code onto the board and then watch it run that. Sometimes if you've used Arduinos in the past with JavaScript, a lot of times you actually still have to have them connected to the computer, all right?

[00:02:18] And you have to replace the firmware and all this fun stuff. With the Tessla 2, it is JavaScript out of the box. You can actually deploy the code to run on the device itself. That built-in WiFi is really cool. You can actually program it over WiFi, you don't necessarily need to plug into a computer.

[00:02:35] We're gonna leave ours plugged into our computer, cuz who needs to invite the chaos of 20 devices programed over WiFi in a room together? So we're gonna use USB. But if you're using it somewhere in your home, you could install it somewhere and still deploy code to it over the WiFi.

[00:02:51] It can run a web server that you can connect to that we're gonna do later today. So a lot of really kind of cool things involved. So tech specs, if you care, it's not something that we need to know, but just fun trivia, is that there is 64MB of RAM, 32MB of flash storage.

[00:03:09] WiFi, like I mentioned, the USB ports that you can see on there. It can actually work as a WiFi router, if you really wanted it to, and JavaScript is a first class citizen on it. So, as I mentioned, you can program it USB or WiFi. We're gonna use USB, because who needs to invite that?

[00:03:30] Cool, so this is kind of some other views of it. What's really kinda interesting for our purposes is on the side there are a bunch of GPIO ports. What does GPIO stand for? It stands for General Purpose Input Output, which I think I have on another slide. But let's actually kind of look at what we have.

[00:03:52] So we have a A port and a B port. They are slightly different. Not all the ports are the same. If you're just using general, like I need to use something very simple, you can use any of them. But some of them have certain capabilities that others don't.

[00:04:06] The first one on each side is ground, and the second one is some power that we can use if we need to power a given component. The rest are actually, yep, is just input and output, we have 16 ports. Starts with B0 and A0, because programming, we start with 0.

[00:04:23] It makes sense. There's actually additional 5 volts of power on the top, kind of by that USB stack. In the way we power it as well as extra ground, stuff along those lines. We're not gonna use any of those. The WiFi is at the bottom. So on and so forth.

[00:04:39] There's actually from built-in LEDs that we'll actually get started with, and a few things along those lines. But we're actually gonna kind of wire together our own components for most of this workshop. So yep, GPIO, I'll say it a bunch of times, there will not be a quiz on it later, general purpose input/output.

[00:04:57] All 16 pins, as I said earlier, can be used for GPIO, but some pins do stuff other pins don't. If this slide stresses you out, do not worry about it. You actually don't need to know any of this, except for that third bullet point. And when you need to know it, we'll get to it.

[00:05:15] This is just general. If you're curious what all the special things that these ports can do are, here's a slide that you can refer to later. And here it is lined up to the actual board itself. So we're gonna be using the PWM ports at one point, as well as the I2C.

[00:05:33] But all the other fun stuff is just there for general knowledge. But also, if at one point you see me wiring something up, you're like, why did he pick that port? It's one of two answers. One is, it's a GPIO port, and I could have picked any of them, or two, it is one of the ones that only supports a certainly protocol, right?

[00:05:51] And we kinda have called that out. For PWM, that's just a way to actually send some amount of data, anything that can vary between one and zero, cuz think about digital, zeroes and ones is really easy. Anywhere between zero and one, kind of hard. So the PWM ports will actually support that, and the I2C is for some of our more complicated components.

[00:06:13] And so I'll be plugging in to ports either zero or one for that, and ports five or six for things when I need something between zero and one.