 So now it's true that we don't have hard work for everyone, but also para-programming is a great practice. Para-programming with robotics is an essential practice. One person chases after the robot and the other one hits control C over and over. You'll see I'm not joking in the course of the next two hours. Do you want to pair with this gentleman? Would you like to participate? You're going to make a new friend soon. Would you like to pair with this gentleman right here? You guys should come closer to the front because you're also going to need to plug in some stuff that we're going to start handing out right now. So those who have computers connect to the scale Wi-Fi and go to github.com forward slash hybrid group forward slash CylonJS Workshop 2016. I meant to do a bitly link, but I got distracted. In which case it would probably be bitly forward slash CylonJS Workshop 2016 or something ridiculous. So as everybody got a partner to pair with who's got a computer with a keyboard. Alright, excellent. So one person from each pair raise your hand. Okay great, we have enough machines. What about you? We'll do this at home later. Over and over for the next six months until summer. So we have to connect all these Edison's to the various Wi-Fi's. This one's ready? So this is the first one that's ready. Back here. So we'll start in the back of the room because everyone always starts at the front. Are you here to participate? Oh okay. So you're going to make a new friend really soon. Actually we'll start here because I have a feeling that I should have some method to the madness. So you guys are going to need to work together and you're going to need to work with this hardware. And I did not know that we're not tables in here. You might want to do some rearranging of things to disconnect chairs and flip one around to make a kind of pseudo desk. A sitting desk as opposed to a standing sitting desk. I apologize for that. Exactly. Let's just discombobulate the room because that's nothing compared to what we're about to do. So you guys are Cylon09. And this is your starter kit. By the way, all of this stuff has to be given back at the end. First of all, we don't actually own it. It's loaned to us by Intel and Sphero. The other thing is this software is in the free alpha state. So you will hate me for life if you take this home and try to make it work. It may work once, but it will probably not fire again without reloading. Alright, so in here is your starter kit. So the most important thing in here right now is the power supply. So this is one of those really fancy expensive international power supplies. So it has adapters, peanut gallery, go. So you know what country you live in and the appropriate adapter, the other ones will not fit. It doesn't give you that many options. Do we have the next one ready? Okay, you guys. We're just going to go at random. You guys are Cylon01. Here's your starter kit box. The important part right at this instant is the power supply. Yeah, it's a, I think it's 12 volt actually. Anyway, you know how to connect. The Edison, in the box you've got the Intel Edison. These Edisons are special besides the fact that they are, as I call it, artisanal, hand-crafted, globally sourced, signed by the artist. So they have a, that means a digitally signed, of course. It has an SD card that we're booting this magical software off of. It has a jack for the power supply. That's what you're going to plug in. You don't want to unplug or re-plug or anything. Once you plug it in, just let it boot up and we'll go from there. Yes, do we have any more ready? Okay, I'll grab some. Here, why don't you give me a couple of them. I could probably do them faster in C2, I'm guessing. We're doing this so you don't have to. By the time we get through all of these, you should know how to do it really well though. So in order to save time, one person from each pair come up to that gigantic flight case in the corner and take one of the green boxes only. Two will cause you a lot of troubles because there will be like twice as many parts now. So Dead Zone is the Wi-Fi you want to connect to. So the Intel Edison can run several different flavors. It actually comes with a Yachto distribution pre-installed. Many people don't realize that Intel is actually one of the major contributors to the Yachto project now. So Yachto is a, let me just put this in real fast here. So Yachto is actually a system for building embedded Linuxes. You basically create sort of a script that generates a purpose built embedded Linux distro for your particular device. Exactly, exactly. If you have a drone, the question was you would have, you know, create a special Yachto build that only has the specific things that you need on it for the, you know, so you don't install any external dependencies. And in fact with Yachto, you also don't, like, who here uses Ubuntu? Yeah, I call it the windows of Linux and I mean that in a good way. In other words, you can actually kind of figure out how to use it if you don't know anything at all. Like, you know, Ubuntu is what I have my parents install. Yeah, and oh by the way, the, I use the Dell Sputnik, which is the Dell developer laptop, comes with Ubuntu pre-installed and all of their drivers are in the Linux kernel. So go Dell. So the Wi-Fi password for dead zone is the word Salvador, like Salvador Dali or Salvador Evans who's my son over there in the corner. Either one will work in theory. Sometimes it seems like the 5G, which should be working better, but now everyone's using that frequency spread. So you guys can be silent 11. So pull out your power supply. Yes, perfect. Plug it in and then plug in silent 11. All right, on to the next. I would have done all this back in the workshop, but I was busy trying to install the software. And then I had this guy constantly asking me, Dad, are we leaving yet? And I'm like, um, yeah, yeah, we're leaving now. We're leaving in five minutes an hour later. Okay, we're leaving in five minutes. Are you sure it's, hang on one second if you don't mind. Let me plug this in and get a booting. Then I'll take a look. Bring your green box. If you're missing anything you think is missing, bring it over here real fast, please. Can I take a look? You've got the connectors, but not the actual power supply on there, huh? We have a couple extras as well. How many people, you have a power supply? You don't have a shield, actually, in there already? Some bad people didn't return their stuff. There might be an extra one in one of the boxes. Who's this, yours? Okay, hold on. I mean you want to run, it's, in theory, yeah, I know. So in theory, you can run off of your USB ports power, but yeah, one amp will work if it's 12 volt. Yeah, that should work. It only draws as many amps as it needs, so. Okay, sorry, so what are you missing? Oh yeah, the shield is what that's known as. The base shield? I don't know what it is. What you mean by motherboard? I'm sorry. Oh, the Intel Everson? Okay, yeah, we haven't handed those out yet. Don't just come up here if you haven't actually talked to me yet. What I mean by that is if you just arrived, stay where you are and find a partner. If you have already received equipment and you're missing something, come up. Otherwise go away for a moment, and I come back in one second. Please, thank you. Okay. You don't need a USB cable. You will need a screen. Oh, we're not actually using the screen. So that problem solved. You need a shield. What do you need? You could probably do that fine. I have some extra ones if you give me a minute to pull some out. I have extras of several things, but not everything. This one might be bad and it might be good. Give it a try if it's bad. Come back, please. All right, you need a shield. I brought 16 boxes. You didn't bring any extra shields by any chance, did you? You know, Grove Shield? I mean, I could give you this one, but then I can't show anybody anything. Shoot. This one is the one I was using. No? No, no, no. Listen, don't run around here because you're pulling out cables and stuff. Okay? Thank you. Don't worry, I got it covered. Don't ask me questions, please. I don't need any extra ideas. I am the boss here. You're the employee. This is America. Yeah, no worries. Make sure you tell me I took that out of here or else next time I go to do my toy hub demo, I'll be like, oh my God, where's the shield? Okay, listen. I'll tell you that I'll need your help. You'll see what's going on when you hang out for a few more minutes. All right. All right, who has just arrived recently and hasn't gotten anything going yet at all? Okay, how many boards do we have left? And I have two more that I'm doing. Okay, we have 12 and possibly 11 boards. There's 11. Okay, we have 11 boards. That means that 22 people can pair up, or 33 people can trio up. You understand how this math works? This is open source. Please self-organize with one additional criteria. One of these two to three people must have some type of computing device or the keyboard because we're going to do programming and it's really, really hard to do programming with text without a text keyboard. Can't be done, but it's very, very hard. It's a great talk from a visually impaired gentleman who created a complete VIM plug-in that allows him, despite the fact that he's legally blind to program and that guy is the patient of a saint. Luckily, we don't have to. Anyway, so I'm just trying to complete, we have to get these boards connected to our own Wi-Fi. You will not be able to go to the conference Wi-Fi and get to your Intel Edison at the same time because port scanning and other nasty things have been blocked and the internet of things means things can talk to each other. So we brought our own router. It's called DeadZone. But before you go to DeadZone, go to GitHub, forward slash hybrid group, forward slash CylonJS workshop 2016. And if you are get oriented, you can just do a get clone. If you don't know what get even means, then you can click on this download zip and that will download a zip file. But when you on zip, it contains all the files for the workshop. If you do not do that, you will have to switch back and forth between DeadZone and Scale 14x about 13 times over the next two hours. One hour. Two hours. Sorry, two hours. The next two hours. So that's going to be kind of unfun. You don't want to do that. All right. So has everybody found a pair or trio of coding? Now pair programming is a great practice and it's an especially great practice when programming physical devices. Because one person can be staring at the numbers on the board or chasing after the robot and the other one can be hitting control C or save or whatever seems appropriate. All right. No. I'll tell you when. So while you're waiting, making sure that you've organized into clusters of 11 total numbers of the set, members of the set of two or three, right? So one of your pair or trio should have one of these green boxes. Green boxes that are labeled Grove Starter Kit. Inside that box is a power supply, like a wall wart. You're going to need to plug that into the adapter and also you might want to move things around so you could turn a chair into a desk nearby. We don't have any tables in here. I'm sorry. So once you've downloaded the files from GitHub, you will not need to go on to the Internet again. You can connect to DeadZone. Wi-Fi, SSID is DeadZone. The password is Salvador, like Dali or my son, Salvador Evans. So I want six is ready. Whichever one you can get access to, there's plenty of Wi-Fi interference. I mean the scale Wi-Fi is really good. Unfortunately, the system administration is also good and they didn't allow us to do bad things that we normally do. So, you know, go figure. All right. Cylon 6. You need to find a friend. We don't allow anyone to go solo here. Who do you guys go? You are Cylon 06. Cylon 12. This guy already has a board and you guys are just bored. It's like I'll trade a beer for a seat at the Edison table. Just pull anyone from any of the other bags. They're all the same. No, I'm saying any of these growth cables will work. Oh, you need ten of them. Oh, I see what you're saying. Like the accelerometer, for example, or the piezo. Yeah, the piezo we're not using. Sorry. Yes. There was the right answer to the right question. Okay. Are these also needing to be done or are they done? Oh, okay. All right. Hang on one second. I'm on the last one now. Yeah, luckily we don't need soldering irons because of these growth connectors. So, in those IOT starter kits that are so wonderfully branded, made by Seed Studio and sold by Intel. So, inside those are these various little tiny boards with various small four wire cables that are known as grove cables, like a grove of trees. You guys have a board? You guys have a board? You have a board and you need one. You guys didn't get one yet? Okay, good. All right. You are Cylon 15. You are Cylon 13. You are Cylon 10. Yes. But you don't need to actually put them on yet if you don't want to. You can. So, if you have these weird little boards and you have to plug them in and it looks really scary and you don't know what to do and you need help, it's okay. We will plug that in for you. All the other stuff is really easy to plug in though. Right there. Right here. We have a couple more here. Any more of these ones? You are sure? You are sure? It's going to work when I plug it in because it fears me as it should. It fears its creator. I think it's awe. It's not fear, exactly. It's awe. That's the way I like to think of it anyway. Everyone needs a board. The problem is we don't have enough for everyone. Yes, it's 11 groups in total, but total numbers, number of members of this set must equal 11 at the end, precisely. And it will not be fun. You can group up with four, but I did mention that we had very limited supply. It's whatever he has left because this is the board that, as you can tell, this board is not happy. I believe that's because you're not supposed to hot plug things with SD cards in them. I'm not sure. I know. I'm aware of that. He points out there's more than 11 groups of people. Well, we have more green boxes than we ended up with boards because a couple of our boards are not booting for reasons that we do not know yet. I'm not sure. It looks like this board is not going to be passed out of the bowl. Yeah. I'm not sure. Out that door and ask somebody. Oh, no. Yeah, a bad SD card. You see it? That always happens because of a bad SD card. I didn't get that. Maybe you were plugged in. No, I know what I'm plugged into. I did every other one, trust me. I'm pretty confident that some of these SD cards are not going to make it. We have power supplies in there. You know, in here, give them one of these. I just do not mind. We can sort that out later. We're not ready for that yet. Well, are you on the dead zone network? And you know how to get to the, what did you type in in order to get to it? That won't work by itself. We're going to get to that in a minute. Thank you. That way we can do it all at one time, hopefully. But you're the first, you're special, you're quick. We're almost there. How are you guys doing? Oh, that's pretty good. Okay, so for anyone who's already like these guys and the gentleman who just was talking to me, I can't see that far, but he was here a minute ago. So if you have gotten your Intel Edison plugged into a power supply and the light is turned on, and your computer, your notebook computer or whatever, a separate computer is also on the dead zone Wi-Fi network, the way you get to your Edison is written on the box that has a name like Cylon 01. Who needs the power supply still? Who needs the power supply still? Anybody need a wall wart? So the way you get to the Edison is you type in the name of it .local, and that way it will resolve to your board. So if you have Cylon 01, you would type Cylon01.local into your web browser's address and hit return, and you should get a web page. The password for dead zone is Salvador. Is that things not plugged in that would appear? Maybe you turn on the, alright. At last we have you. Now we reel you in. First the electricity starts. And then the zapping. Alright, so can everybody see the blue web page with the name of your Intel Edison on it? Cylon06.local. If you are on the dead zone, and Windows often has a problem because Windows is not good. So one of the things that you can do is if you have a problem with that, then you need to just, if you just, I can look it up the DNS entry for your IP address. But is it, what's that? If you want. You can just access it by IP address. So who is, so who's the first one who's having trouble? 06. Please do not SSH into these boards. Thank you. If your computer, it may switch over to scale away from dead zone. Mine does that all the time because it's, you know, it's like trying to get to a route that it can find. Cylon06. You are this IP address here? 192.168.0125. Give that a try. I'm going to do the same thing for everyone real quick as soon as I know that they're connected. Because all these IP addresses look the same. It's some 192 something, I don't know. Okay, who's the next person who needs this info? 13. Are you guys on Windows? Yeah, so you're 149. You guys good? Make sure you're on dead zone. Okay, so we are on dead zone. We're getting a ping back from it, but are we getting a ping back from it? There it is. All right, you're good. Who else needs that info? Todd also? No, we can't. Okay, who has everyone see the blue webpage with the name of your Edison? If you do not, see it. And this is a test of your ability to go through truth tables and the exclusivore. If you do not see that blue page, raise your hand. If you do not not see that page. All right, everyone should have their hand raised right now, please. I hope. Okay, good. All right, excellent. All right, so now, if you go to the same web browser page that you just saw the hello page on, that little yes it is working. Okay, and you change to port 8080. In other words, the same name. So if it's pylon01.local, you go into, and you right after .local, you put a colon 8080. And hit return. If you have an IP address, you just put it at the end of the IP address. So if it's 192.168.0.100, colon 8080. Hit that, and you should see the Cloud9 editor that's part of the Lobot system. It should prompt you for a username and password. The username is pylon, the password is robot. If you're in this room, you can kind of hack each other, and they're going to have to work it out. If you're outside this room, you don't know what we're talking about, and you're just not on the bus. Or on the spaceship, as is the 21st century version of same. So you should see the Cloud9 editor come up. Yes, excellent. It takes it a little minute, because it's actually initializing a whole lot of stuff. And this is basically the end of the installation. Once you see this, we're ready to start programming devices. Some day we'll just be able to turn them on, you'll go to it, and everything will just work, and we're really close, really, really close. We still got maybe two more weeks off. This gentleman asks a very interesting question. How many computers can hook up to the same Edison? So the answer is more than one. Cloud9 lets you do collaborative editing. So if two people want to pair a program on two machines, keep in mind one very important fact. You only have one physical device, so you can't both run separate code at the same time, trying to talk to the same physical devices and expect them to work. But it does work. It's very cool. So you should see the Cloud9 editor. Hit refresh or something. It will automatically go there. It just takes it a bit to load. Yeah, the first time it has to download all the assets and initialize a bunch of JavaScript-y stuff. Well, everybody at once is doing the exact same thing on my poor little travel router. If my travel router catches fire, or remember, do not put out electrical fires with water. Throw yourself on it. Okay, it's definitely taking a sweet time, huh? Wow, that's pretty slow. We probably should have told people, like, okay, first you and then you. So it's about 80-80. I think you have a slash in there in the wrong place. I can't see by far, though, so... It just seems to take a long time forever to load. I'm not... I'm not doing that. Yeah, it's got to initialize and download a fair amount of stuff. So what we're doing is we're downloading the apps. Yeah, well, no, the board is running a web server, and then this web page is representative of an application that's running on the board itself. And it's taking a while. Where is the physical device that you're talking about? The board. Everything that you're doing is right now on that board. If you're going to the Internet, you'll never be able to see your board. Unfortunately, though, we're all going to them at the same time, and it takes a little bit. Yeah, they're like... No. So the delay is pretty much the Wi-Fi, I suspect, because my router is just, like, sweating. It says you're only supposed to have about 15 users simultaneously. I have an interesting idea. Half of you hit the X button to stop downloading, and the other half of you hit refresh. I don't know. This is anarchy. We're supposed to, like... We're like a volunteer fire department. Everyone's supposed to, like, grab a bucket. Yes? Those guys are only two in the front. Yeah, no, it is loading, but... Okay, let's do it this way. Did you guys get... Is it loaded yet? I think I see it. I see something. Oh, okay. Okay, you stop downloading, but hit X. Okay. You guys hit refresh. You guys hit X. You guys hit refresh. You guys hit X. Oh, you guys hit refresh. You guys hit X. You guys hit refresh. Okay, we don't worry about them. Okay, okay. Well, let's see if it's the router. I'm not going to be... I'm just going to be showing them. I don't have equipment of my own. It's very, very warm. It makes me feel so relaxed. Under times of stress, you just... It's like Nintendo. Everyone do it again, though. Yeah, exactly, but that's going to be too much insulation with the cold. We need a little plastic bag and then a napkin to wipe off the condensation. Maybe we're over-engineering it. I'm not giving up. That's not for later. I mean, that'll be later, don't worry. It's later. You'll see. Patience, my young apprentice. Has anybody gotten the IDE to load completely yet? Was that yes? No, maybe. No. So far, no. It's amazing that no one can actually has gotten it to load yet. All right, hang on. Let me try this here. Everybody click X. Let's just... Everybody click X to stop loading your browsers. Let's just try one of them. You guys, what's your name? Eleven? Okay, definitely don't refresh. I love them code. Don't refresh. This is what you're supposed to see. Okay, so we know it does work. It works on my machine. All right, class dismissed. You're all good at... Oh, it just... It only needed one token, one to be put up as an example, and all the rest of them fell in line. Yes, please. All right, excellent. What's that? Yes, please. They need to actually go to their IP address or see name and just get the editor loaded. Oh, just go around and see who does not have it loaded, and they should just refresh. Ah, yes, please. So if you do not have it loaded yet, put your hand up. Okay, still loading? Okay, so you guys might be wanting to refresh again as well. Go ahead. You guys also the same. If you're using Chrome, try Firefox. If you're using Firefox, try Chrome. I don't know. I'm just like, I'm guessing right now. I use Chrome for Chrome apps. I use Firefox for everything else, mostly. I'm just guessing. Because this is Firefox, so we could try Chrome and see if I have to reproduce that. You got it loaded. Some Chrome users have it loaded fine, so I'm pretty much just wasting your time with that. Oh, good. Yes, but not yet. Maybe try another computer. But only do it on one at a time. Just checking. Oh no, under these circumstances, I found that with AV fail, the smarter the presenter, the more AV fail. That's my story and I'm sticking to it. It's worked out well so far. Yeah, but then you'll be programming their board and I'll be like, why is our life linking? Go in and get rid of everything but the port. Yeah, just hit that. So it's doing the redirecting. It's just like having trouble serving up the assets to you or something, because you see how it... Oh wait, something else is getting... Eventually maybe the browser will cache everything you need. All right, okay, he's got it. You've got it. Some people have it. I'm not sure, but we've got to keep moving along. So much time, so little to do. Wait, strike that, reverse it. All right. So there are a couple of kind of hacky things besides the whole thing, but there's some specific hacky things that you're going to have to kind of memorize to get this all to work. Now under the normal cloud nine, you would just like go click on this run button. Don't do it yet, okay. So you see there's a program already loaded in your IDE called blink.js, right? So that is the whole old world of things. It causes an LED to start blinking on and off on the Edison board itself. Which LED? The built-in LED, of course. Which is on pin 13. So it's just one of the built-in LEDs. You don't have to plug anything in at all to see it work. All right. Now one very important thing to realize is that we had to do a little bit of hacking to get this to all work so that you could actually run it, not with admin root privileges on the board itself. This is a lot of what this is about, is just making it so that we can have boards that are not immediately pwned the minute that we hand them out. So when you click on this run button, the first time it's going to fail. Okay. So go ahead and click on the run button, and you're going to see it, some stuff show up down here in the output. A new pane will appear, and you'll see some, it'll kind of start churning. It'll look like it's about to start. It'll put out some messages and then it will fail. Okay. Who's gotten to that point? Yeah, just click on the run button. Well, don't click it again. So it's trying to connect. I can't see that far because my vision is extremely bad, and that will, oh, I can do that. All right, so it is loading. It's just kind of going slow. Okay. Oh, I see it's going to stop. No, it is loading. Give it some time. Yes. Okay. So in order to run the code, down here, let me see if I can find it. Excuse me. Down here at this tab at the bottom, the one that has the run, output, the error, you'll see over here on the right, let's see, who started on 11? Are you guys running anything right this second? Perfect. So hang on one second, okay, don't do anything yet. I'm going to reconnect to you and see if I can see your output. Well, I can't display it on the screen, but it doesn't matter. On the right bottom output tab, you've got this little tab that says, runner colon node.js. Click on that, and a bunch of languages will appear. The one at the very bottom says node-mraa. And that one. We have to create a custom runner that runs the code under special privileges in order to go through this workshop. We'll get that fixed. What's that? Node-mraa. Node-mraa, choose that one, and then click on the one button that's down in that little pane at the bottom, not the one at the top, but the one in the little pane at the bottom. Node-mraa, the last one on the list. And then click on the run button. And that LED will eventually start blinking. Yee-gods. That's all I could say is I feel bad. What kind of programmers are these guys? Oh. Yeah, when I published the repo, you're like, your name's all over this dead program. I know, it's JavaScript programmers. We're a bunch of y'all crazy wild people. All right. Now, if you want to run any of the programs during today's workshop, you're going to have to, when you load the program into your editor, the first time you're going to have to run it, it's going to have to fail, and then you're going to have to go choose the run or node-mraa and then run it from down here. I'm really sorry, but that's better than three hours of installation. We'll get that fixed. You're the test subjects, I mean, experimental group. I mean, volunteers. Sorry, volunteers. All right, excellent. It's hard to say. Still loading. I found that, and then we clicked it. All right, and then... Oh, you still need to reconnect, so click on it and I'll just reconnect now. How are you guys doing? And you have a blinking LED? Excellent. How are you guys doing? Any luck? It's the last one on the list. It's node-mraa. Node-mraa. And then you must click this run button. If you keep clicking that run button, it'll keep running the same thing that will fail every single time, opening new fail pains. A new form of fail of pain. Yeah. I know. I have seen the CTOs of Fortune 500 companies literally get up and jump up and down because they made an LED blanket. And I was really happy for them, but I also thought, wow, you never did this before. All right, so let me tell you the other little hacky thing. Do not click on the stop button. You can click on it, but it won't actually stop the program. You have to click in that tab and hit Control-C. Really, really sorry about that, but it was better than the three-hour install. This is my mantra. I say this after about eight hours of working on this, and it's like working incrementally better. I'm like, it's better than the three-hour install. I just buy the eight hours, but it's better than the three-hour install. Control-C. I know. We're kind of leading up to, you know, the Ultra Uber hacker, because, you know, you may have noticed there actually is an SSH terminal session in there, and you can, like, type terminal commands. This thing will, like, barely work if you don't mess with it, but if you mess with it, well, I don't know. Did you find Nodemar in the list? Yes, we got it blinked. Okay. Has everybody gotten... Okay, anyone who has not blinked yet, hold your hand. You guys are still trying to get the IDE to load. Yeah. And you try it on the Mac, and you try it on... It definitely won't work then. All right. So, click down in here in the running window output, the one that shows Nodemar on, and hit Control-C to stop the program. The light will stop blinking. It will either stay on or off, depending on its last state. Confusion, in my case. Pandemonium. All right. So, now we're going to get into the glorious, awesome cables. So, you have... So, we're going to end up with all of these cables plugged in all at the same time. Only a few humans were harmed in the creation of this demo. All right. So, you have this little thing called a shield. So, in the world of the Arduino, which is probably the world's most popular microcontroller, who here has ever done any Arduino anything at all? A bunch of people. So, the Arduino, they kind of developed this concept called the shield, which is a daughter board in the more traditional nomenclature. It's a small circuit board that attaches to another board to perform some secondary functions. In this case, it plugs in right on top of your Edison. I think I have a dead Edison I can use. Kind of like dead Kennedys, except more science-oriented. So, the question is, can it be a plug? Yes. However, if you've never plugged in one of these and you see all these little pins and you're like really nervous because you don't want to bend one, you really do not want to bend one. So, one of us will come over and plug it in for you. You can do it while it's powered. As long as you plug it in the right way. You must look very carefully. You'll see it only plugs in one way because of that little blue socket. This part here. So, make sure all the... I usually lay it in one side and then lay it down on the other side. Make sure all the pins are in the right holes and then gently push down. No pressure, but if you mess this up, people from Intel will kill me. You'll be like, oh, I'm dead programming. So, Sal, he's actually dead now. So, if right now you're really mad and frustrated just like bend a pin. You're like... Tell me. This is the bad power supply. Okay. This power supply needs to be marked. I'll just... Okay. So, the first step is you're going to take the blue LED... Where's my camera? There we go. So, you're going to take the blue LED out of its little case. Right? So, you see that you have a little grove board and it's got the LED already plugged in. If not, LEDs have a positive and a negative. Luckily, for the dyslexic among us, like myself, I always think, oh, the other left, right. Yeah. If you look at the board, you will see there is a picture of the little... The LED has a flat side. You see how if you look at the round LED, the one side of it's flat. It's hard to see in the focus, but one side of it is flat and the rest of it's round all the way around. And you see there's a little picture on the circuit board, it's still screened on there, and how it's got a little flat. That's how you could tell that the flat side is negative. So, the ground is marked. Just that way, if you can't remember left and right, fortunately, or plus or minus, which... So, my friend, Sarah Huey, so she's a hardware hacker from Australia, has done a lot of really, really cool stuff like JavaScript and NodeBots and a lot of other stuff. So, Sarah did a great talk in London last year and she pointed out something that a lot of us forget, which is, so red, typically red is the plus and black is the minus. So, Sarah points out in her talk that a lot of us who have been kind of playing with this stuff take everything for granted that everyone knows and that we shouldn't do that. We shouldn't make those kind of assumptions because some people are scared to ask questions like I used to be. Now I don't know that much, so I'm fine. But it's very good to remember, so color coordination. So, take your little cable, the Grove cable, and plug it in. It only goes in one way because of these little slots. So, you plug that in to the board like this. And then you take that and you plug it in to the connector that's labeled D3. D3. And plug it in. It will only go in one way. It won't plug in. My grandfather, the engineer, taught me never force anything as I had ruined something expensive of his, I think. Something to do with his drafting table, as I recall. I don't remember what, but he was kind of mad. I could tell that. Alright. So, now we're ready for the software part. So, if you've downloaded the zip file, or if you've done a Git clone, you have the files on your machine. And one of the files, oh, whoops. And this is what happens if you do what I told you not to do, which is don't download it all at once. Actually, I have it in my IDE. So, you have a file labeled 1.js. Okay. So, we're going to start layering on each program that we're going to use is going to add more features to the previous program. You're not going to actually need to write any code. You could just copy and paste the whole thing. Or, you can use what Cloud9 has, and you can actually load the code right there. And I believe it's, if you go to the file menu, and you choose upload local files, you can actually upload, if you've unzipped the directory with all the files, or if you've done a Git clone, you can do it all at one time. Because we are programmers, and we are very lazy. Do not forget this, as you are working so hard. 1.js. So, let's take a quick look at the code. Since that, of course, so we are in the software wing of the hardware hacking revolution. So, naturally, we assume you do everything with software, and only gradually do we assume you have to do some hardware. As opposed to electrical engineers, or mechanical engineers, who typically do the opposite. First, you make a circuit, and then, oh, god, we got to write some code. So, we're more code oriented. So, let's take a look at the code real fast. So, with Cylon.js, it's a Node.js program. Who here has done some Node.js programming? Quite a few people. Who's never done any JavaScript in their entire life? I know. Since the guy who raised his hand real fast, who knows JavaScript? So, our use of JavaScript is a little bit, sometimes, the way people use Lisp. It's a little bit more declarative, and a little less imperative. So, let's see what we mean. So, in Node.js, the first thing we do is we need to compare a var named Cylon, and then we say that's equal to require Cylon. Right? So, this right here is saying, bring in the whole Cylon package that's already been, or in NPM terms, the module. Bring in the Node module that contains Cylon's core. Okay? So, then we're saying Cylon.robot. Okay, the robot is the main thing in Cylon. If you're good, I'll feed you today. And if you're not, I'll still feed you today. If I'm not, your mom will feed you. All right, so, Cylon.robot, all right, and we're giving it a name. So, in JavaScript, this is a hash. So, one funny thing about JavaScript is everything's an object. Sometimes that gets a little crazy, but it's also very useful. So, we're saying the robot, we're passing it, and we're saying the name is doorbot. And then we're saying there's connections. In Cylon.js, there are three concepts. You have connections, you have devices, and you have work. So, connections, connections are how you're actually going to physically communicate with a particular device. You just plugged in the speaker, didn't you? It's actually the buzzer. The speaker is even worse sounding. So, connections are how you're actually going to physically communicate with something. It could be over a serial interface. It could be Bluetooth low energy like the toy hub demo. In this case, we're actually going to communicate directly with the general purpose input output pins on the Intel Edison itself, the GPIO. So, we're saying we have one connection to the Edison, and we're using the adapter for Intel IoT. That means the Edison and the Galileo and some unreleased Intel-ish stuff. All right, there's no video, we're fine. So, we have a connection, so we're saying use the general purpose IO of the Edison. Then we have one device. Connections is how we're actually going to talk to the things. Devices are behaviors. So, we have one device. In this case, we have a blue named blue, and its driver is the LED. And it's on pin three, and it's connected to the Edison. This is because we can have different devices and different connections all going at the exact same time. You remember the Toy Hub demo? We were talking to some Bluetooth stuff, and we were also talking to a server. So, we're going to have multiple connections and devices all going at the same time. We're starting with doing blink. Same exact thing as blink. So, we have one device, which is this blue LED on pin three. Remember you plugged in the blue LED to D3? Right? And then the work that we're going to do. Yes, a question. This is a friendly name, but the adapter name is, this actually loads in Cylon-Intel-IoT automatically. This way, all of your dependencies get pulled in by the core Cylon module, and you don't have to say require this and require that and require the other thing. If you've used Node, you know what I mean, and if not, don't worry, you won't have to worry about it. Once you do that, initial require Cylon. So, then we have the work that we're going to do. So, the work that we're going to do is we pass ourselves in. Who here knows about this in JavaScript? You liars, you don't know about this. None of us know what this means. So, in JavaScript, there is a thing called scope. In fact, in all programming languages, there's a thing called variable scope. Is this particular variable actually exist? So, in compiled languages, you get an error when you try to compile it. In dynamic languages, it just rocks on until it hits a runtime error for no apparent reason. So, because many times in code, people say stuff like var self equals this, and they keep saying this over and over and over again because we're really bored of that. We just say, you know, we're going to pass in this to the work function, and we'll call itself that way nobody's confused because this is a reserved word in JavaScript. So, now you know a tiny bit more about this. All right. So, then when you call the set interval function in JavaScript, set interval is a function that means do something over and over. In this case, the function that it's going to call is it's going to say self.blue, which refers to the blue LED, .coggle. Coggle is a function on the LED driver. If it's on, it'll turn it off. If it's off, it'll turn it on. So, it's a very, very simple behavior. And then set interval gets called every 1,000 milliseconds or every second, and then we start that. So, now if you have this in your IDE, opened up in one of these tabs, and you click on the run button up at the top, and it'll take a little while and fail, and then you go over and you choose runner no-mraa, and then you click on the run button again, the blue LED should start blinking. So, everybody please do that. The blue LED. So, 1.js, we haven't found it and they're cheering. It's probably going to be so unfair. I can't get through. I'll go around. It doesn't look like you loaded the right repository at all to me. It looks like you've loaded Cylon and not Cylon.js-scale, or a workshop, whatever I said it was. Yes. Yeah, you loaded Cylon itself as opposed to the workshop content. Yeah, if you just swap, it won't affect that. So, if you just swap over to the, sorry, you're on Windows. Yeah, if you jump over to the Wi-Fi, for scale, yeah. Just go over there and grab the code. This may be the first of 12 now because you already did the first one, so you may have 12 more. No, once you download it, you're fine. Okay. How are you guys doing? Excellent. Are you guys blinky? Yes, that's it. That's so either clone that repo or just download the zip file. Not everyone here knows Git. More people know Git than this, but... I was wondering that when it killed any time with different parameters, what exactly are we doing? All you're actually doing is running it under a different user account where we then have the appropriate Udev rules set up so you can do the exports necessary for GPIO. Because the Edison does this muxing in order to... It has an enormous amount of GPIO way more than this. This is just the Arduino-compatible breakout board. So you do all this muxing on the Edison itself to get access to the different GPIO or SPI or I2C interfaces on it, and you can reconfigure all these different ways, but there's some odd thing about it. We work with Intel and we're trying to get it figured out. We don't want everyone just to run everything. It works fine if you just run to this root. I don't consider that even close to acceptable. But that's the reason. Yeah, Raspberry Pi, Beagle Mom Black. You can run not on the Arduino, but talk to an Arduino using the Fermata sketch. It supports a few other microcontrollers. So if you go to... I believe it's... Yeah, it's CylonJS. That one. I meant to have a bit longer length. I'm sorry, that's kind of long. Come over to the other side of the room. How are you guys doing? Step 4, you'll be helping us by the end.