 Apptop comes with Ubuntu pre-installed and all of their drivers are in the Linux kernel, so go Dell. So the Wi-Fi password for Deadzone 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 E5G, which should be working better but now everyone's using that frequency spread. So you guys can be silent on the 11. So pull out your power supply, yes, perfect, plug it in, and then plug in silent on the 11. Alright, 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, yeah, yeah, we're leaving now. We're leaving in five minutes an hour later, okay, we're leaving in five minutes. Who just arrived? Are you sure? Hang on one second if you don't mind, let me plug this in and get a booting and 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 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, oh, 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 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. Alright, you need a shield. I brought 16 boxes, you didn't bring any extra shields by any chance, did you? You know, grove shields? 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've got it covered. Don't ask me questions, please. I don't need any extra ideas, I am the boss here, you are the employee. This is America, there you go, 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 and they're like, oh my God, where's the shield? Okay, listen, I'll tell you the one, I'll need your help. You'll see what's going on when you hang out for a few more minutes. Alright, alright, 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 the 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 file on JS 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 to? 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 onto 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, Psylon 6, you need to find a friend. We don't allow anyone to go solo here until you guys go. You are Psylon 06, Psylon 12. This guy already has a board and you guys are just bored. So I'll trade a beer for a seat at the Edison table. Oh, just pull anyone from any of the other bags. They're all the same. No, I'm saying any of these Grove cables will work. Oh, you need 10 of them. Oh, I see what you're saying. Like the accelerometer, for example, or the piezo. Yeah, the piezo we're not using. I'm sorry. Yes. There was the right answer to the wrong answer to the right question. 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 Grove 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. 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? This one I'm doing right now. 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. The total 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. 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. This is... 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. No. Yeah, a bad SD card. You see it? That always happens because of a bad SD card. Okay. So... I didn't get that. Maybe you were... No, I know what I flicked into. I don't know. 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. All right? I just do not mind. We could sort that out later. We're not ready for that yet. Well, are you on the Deadzone 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. Did you already get into it? Yeah. 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 Deadzone Wi-Fi Network, the way you get to your Edison is written on the box that has a name like Cylon01. Who needs a power supply still? Who needs a power supply still? Anybody need a wall wart? Okay. So the way you get to the Edison is you type in the name of it dot local. And that way it will resolve to your board. So if you have Cylon01, then you would type Cylon01.local into your web browser's address and hit return and you should get a web page. The password for Deadzone is Salvador. That thing's not plugged in that would appear. Maybe you turn on the... All right. At last we have you. Now we reel you in. First the electricity starts. It's zapping. All right. So can everybody see the blue web page with the name of your Intel Edison R8? Cylon06.local. If you are on the Deadzone 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. Or you can just access it by IP address. So who is the first one who's having trouble? Cylon06.local. Please do not SSH into these boards. Thank you. If your computer, it may switch over to scale away from Deadzone. Mine does that all the time because it's, you know, it's like trying to get to a route that it can find. So Cylon06, you are this IP address here? 1921680125. 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? So you're 149. You guys good? So you're on Deadzone. Okay. So we are on Deadzone. We're getting a ping back from it, but... Whoa. Are we getting a ping back from it? There it is. All right. You're good. Who else needs that info? Todd? Also? No. Okay. Everyone see the blue web page 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 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 write 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 passwords. The username is Cylon. 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 the 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. Someday 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, but 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. Right? But it does work. It's very cool. All right, so you should see the Cloud9 editor. Yeah, hit refresh or something. I should log into it. It'll automatically go there. It just takes it a bit to load. 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. Wow, that's pretty slow. I'm too told people, like, okay, first you and then you. So it's about 80, 80. Yeah, I think you have a slash in there in the wrong place. I can't see very far, though, so... It seems to take a long time forever to load. I'm not... Are you downloading JavaScript to... I'm not doing that. Yeah, it's got to initialize and download a fair amount of stuff. 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. That 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 like a volunteer fire department. Everyone's supposed to, like, grab a bucket. Yes? Those guys are only two in the front. No, but we really did. Yeah, no, I mean, it is loading. 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. 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. 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'll be later, don't worry. 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. 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. For the love of 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 all get Fs. No. 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? Still loading? Okay. So you guys might be wanting to refresh again as well. Go ahead. And you guys are 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, we are under these circumstances. I found with AV fell, the smarter the presenter, the more AV fell. 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 they'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 you. Eventually maybe the browser will cache everything you need. All right. Okay, he's got it. You got it. Some people have it. Everyone else just keep refreshing, 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 things you can do. 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. All right. 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 have to do a little bit of hacking to get this to all work so that you could actually run it, not with admin route privileges on the board itself. This is a lot of what this is about, is just making it so that we can have boards so they're 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, it'll drop 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. Oh, I can do that. All right. So it is loading. It's just kind of going slow. Okay. Oh, I see it. It's what's it's done. 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. Choose 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. 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 left. 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, I'm 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 he 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 on this run button. If you keep clicking on 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. I'll tell you the other little hacky thing. So 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. But it's better than the three-hour install. Yes. Control-C. I know. We're kind of leading up to the ultra-uber hacker because you may have noticed there actually is an SSH terminal session in there and you can type terminal commands. Please don't. This thing will barely work if you don't mess with it, but if you mess with it, well, I don't know. Did you find node moral in the list? 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... Oh, yeah. It definitely won't work then. All right. So click down in here in the running window output, the one that shows node moral, 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 in the 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 the pin. You're like, yeah, nah, nah. Tell me. This is the bad power supply. No, I'm using mine. 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... 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, silk 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, unfortunately, or plus or minus. So my friend, Sarah Huey, so she's a hardware hacker from Australia, has done a lot of really, really cool stuff with SilentJS and JavaScript and NodeBots and a lot of other stuff. 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, he never forced 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. 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 and this is what happens if you do what I told you not to do which is don't download it all at once and actually I have it in my IDE you can just do that. So you have a file labeled 1.js 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 Cloud 9 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 so don't forget this as you are working so hard. 1.js So let's take a quick look at the code since then of course so we are in the software weighing 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 right so we are 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 here has 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 lists 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 declare 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 I'll feed you alright so we Cylon.robot alright and we're giving it a name so this is in javascript this is a hash so one funny thing about javascript is everything is an object sometimes that gets a little crazy but it's also very useful so we're sending the robot we're passing it and we're saying the name is doorbot and then we're sending those connections so 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 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 over 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 sending 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 intelligence stuff alright 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 a blue named blue and its driver is the LED and it's on pin 3 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're also talking to a server so we can 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 there's this blue LED on pin 3 remember you plugged in the blue LED to D3 right and then the work that we're going to do yes a question yeah you can name this anything you want this is just a friendly name but the adapter name this actually loads in Cylon-Intel-IoT automatically this way all of your dependencies get pulled in by the core Cylon module you can name this and require that and require the other thing if you've used note 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 as 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 it's called scope in fact in all programming languages there's a thing called variable scope is this particular variable actually exists 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 and this dies for no apparent reason so because many times in code people say stuff like var this 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 I'll tell you a bit more about this alright so then when you call the set interval function in JavaScript set interval is a function that means do something over and over the function that it's going to call is it's going to say self dot blue which refers to the blue LED dot toggle 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 okay so it's a very very simple behavior and then set interval gets called every 1000 milliseconds or every second and then we start that okay 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 dash m r a a and then you click on the run button again the blue LED should start blinking so everybody please do that the blue LED so on dot js we haven't found it and they're cheering oh so unfair I can't get through I'll go around you 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 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 wifi for scale yeah just go over there and grab the code this may be the first of 12 now you may have 12 more no once you download it you're fine how are you guys doing excellent are you guys blinky yes that's it so either clone that repo or just download the zip file not everyone here knows get more people know get than this but I was wondering when it kills and then you have it run a second time with different parameters what exactly are we doing now 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 it's a flaw because the Edison does this muxing in order to it has 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 SP or I2C interfaces on it and you can reconfigure it 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 Raspberry Pi, Beagle Mom Black you can run not on the Arduino but talk to an Arduino using the Firmaba Sketch it supports a few other microcontrollers so if you go to I believe it's CylonJS it's 2016 that one I meant to have a bit.ly link I'm sorry that's kind of long come over to the other side of the room step 4 you'll be helping us by the end