Bummer! This is just a preview. You need to be signed in with a Pro account to view the entire video.
Node.js Hardware Hacking LIVE48:09 with Emily Rose
If you’ve ever found yourself curious about hardware hacking, this is an opportunity to see what it takes to get started! Let’s work together to build something LIVE on-stage with several participants from the audience. We will (attempt to) go from 0 to working prototype within the span of the presentation. Individuals that would like the chance to participate will need to have their laptop with them, Node.js 0.10.x installed, an available USB port, and a sense of adventure! I will be walking both audience and participants through the steps involved; from breadboard & wiring, to components, to software. There will be ample time provided for questions, and (if all goes well) a live demo of our newly created projects. The goal of this session is to leave everyone with a better understanding of how easy it is to get started, and how awesome the results can be when you just dive in!
[NOISE] Thank you very much. 0:00 It's a pleasure to be here. 0:03 This is Future Insights live, right? 0:06 Show hands. 0:08 That's where we're at. 0:10 Okay. 0:11 So I guess, you know, to stay in that vein of 0:12 Future Insights live I've decided that we should do everything live. 0:16 So what i'm going to need from you I 0:20 guess before I get started, I should introduce myself. 0:23 Although that introduction was great, thank you. 0:26 My name is Emily Rose, also known as Nexi Love. 0:28 I work at Sauce Labs Incorporated as a Software Engineer. 0:32 And i'm on the mobile R&D team where we're trying to 0:37 get real devices to work in a cloud at scale so that. 0:39 Everyone can test on real devices instead of emulators, because most 0:43 of us who have actually played with them know how that goes. 0:47 So yeah the title of my talk is node js hardware hacking live. 0:50 And like I said in the nature of doing things live 0:56 here, we're going to try to go from zero to prototype. 1:00 In 50 minutes. 1:04 And as you may see I have a table here. 1:05 There's two chairs. 1:08 I'm going to bring you to the next slide. 1:10 Which is audience participation is required. 1:12 So there's at least two of you out there. 1:16 There's at least two of you that fulfill these requirements. 1:19 I'd like you to raise your hand. 1:22 One. 1:26 Two. 1:27 Oh, there we go, we have one. 1:27 I'm sorry, is your name David? 1:28 I've never met you before, David. 1:31 Thank you. 1:32 Come on up. 1:32 Anyone else? 1:34 Not a single person out here. 1:35 No? 1:39 You, are you, I can't hardly see. 1:39 All right, great, thank you. 1:40 It was about to get awkward, cuz I was gonna start, like berating everyone, and. 1:42 That wouldn't have been good. 1:46 So, while you're transitioning up here move 1:48 on to, stage 2 of audience participation. 1:51 We need to get as many observers as we can get or fit on stage, and your job 1:55 will be to encourage our test subjects, observe fascinating 1:58 details that you can't observe from way back there. 2:02 I also have stickers. 2:05 I don't know if that helps. 2:07 So they're kind of shiny star stickers. 2:09 And also moral support for me, because I don't 2:13 know if you can tell but I'm extremely nervous. 2:14 I haven't really done much of this before. 2:16 So, I'd really appreciate if anyone would also like to come up. 2:17 Anyone, anyone at all. 2:21 This is just terrifying. 2:23 Thank you. 2:25 Okay, phase three, for the remaining members 2:26 of the audience, as questions on any 2:29 time as they come up and you can join us on stage whenever you 2:31 like, discuss among-st yourselves or just browse 2:35 predator hacker news whatever whatever it is, 2:38 you know, so you gonna do any way, Alright, so this slide was designed for. 2:41 Figuring out what we're gonna do, but your already here so we'll just skip on. 2:47 All right so, to give you guys kind of a brief overview, of what we're doing. 2:51 If my two participants could try to identify the arduino, that would be great. 2:56 >> [INAUDIBLE] >> You would guess correctly. 3:03 Okay, so 3:08 There we are. 3:12 Arduino. 3:13 features, it's an 8 bit AVR processor. 3:14 It's very, very fast. 3:16 Has a lot of memory. 3:18 Almost as fast as your laptops. 3:20 the, the main feature behind this guy, though, is that it has digital and 3:23 analog IO pin, so if you guys could hold it up for the audience. 3:26 There's this little black rows, see if you were up here, you could see what 3:30 I'm talking about, but you're all probably 3:33 familiar with these so, we'll just move on. 3:34 All right, and then the next component we're 3:37 going to use here is the Ultrasonic Sensor. 3:38 Those are the only things left in the box. 3:41 So if you guys could grab those and start opening those up, that would be great. 3:44 And then the idea behind these guys is they use the the power of 3:49 the sound to determine approximately how far away a, a, a nearby object is. 3:52 They make an awesome annoying feint clicking sound when they're working. 3:59 Surprisingly sensitive. 4:03 They work for many applications. 4:05 So they've been a favorite of mine for, for quite a while,. 4:06 Yes, just crack it open, I have scissors too somewhere. 4:10 A sticker for you, Greg, would you like a sticker? 4:14 Thank you. 4:17 To the rest of you, Greg just got a sticker, 4:18 what are you guys doing with your lives right now? 4:21 OK next component is breadboard. 4:24 Show of hands, how many of us are familiar with a breadboard. 4:26 Okay, so you guys are paying attention. 4:30 You have some okay, so, we'll, we'll kind of see 4:31 if that, it's a, a, r, I can't talk today. 4:36 it's a, a grid of bridge rows, it has a little power rail on the side. 4:39 They kinda get the idea there. 4:44 The last component is, is highly technical,. 4:46 You know don't be ashamed to ask question 4:49 if you're really not familiar with this guy. 4:51 It's called a light emitting diode. 4:53 It emits electricity or emits light when electricity flows. 4:55 Very low power consumption. 4:59 Ubiquitous acronym. 5:01 Pretty inexpensive too so. 5:03 So there's that. 5:05 Oh that reminds me. 5:06 My participants will need LED's to complete their task. 5:09 So heres some LED's for you. 5:14 Various colors you can take your pick but please choose one of each color. 5:17 [SOUND] And once you have selected your LED's, 5:24 [SOUND] great, [SOUND] So, once you selected 5:30 your LED's, and you're ready to go, 5:35 you can get started with the setup. 5:41 I've just published a little Git Hub repository. 5:46 You can see either here or to your right. 5:49 If you have trouble I have 5:53 I have a thumb drive as well. 5:56 But we'll get started there and then now might be a 5:59 good time for the sound guys to start the background music. 6:01 That's pretty much all of my presentation. 6:04 We're like what seven minutes in we've got another 45 minutes to go. 6:07 It's gonna be great. 6:10 I mean have the fact that the rest of you look really bored but. 6:11 Again, I will implore, any of you have, have even an 6:14 inkling of interest in this, to come up and take a look. 6:17 I have additional hardware here. 6:19 If anyone would like to play along, you can just 6:21 kind of, sit on the floor and look really glamorous. 6:23 It would be fantastic. 6:26 No? 6:28 No one? 6:28 Anyone? 6:28 You! 6:29 You sir! 6:29 Right there! 6:29 Yes, come on down! 6:30 You look really interested! 6:31 Yeah? 6:33 No. 6:33 All right. 6:34 I'll have a try. 6:37 OK, Greg's a good sport anyway. 6:38 [MUSIC] 6:38 >> So I guess what we'll do, since we don't have 6:49 a whole lot of additional participants is I'll try to play along. 6:52 With these guys as they get set up. 6:57 But forgive me if there are long pauses, it's 6:59 kind of more of a workshop format than a talk. 7:03 So like I said if you have any questions at 7:07 all please feel free to come up and ask them. 7:08 For the rest of you that are around you 7:13 can just read Hacker News or what ever works. 7:16 [MUSIC] 7:19 [MUSIC] 7:39 And if you guys could just let me know when you're ready. 7:44 When you've got the software installed then we'll 7:50 get on to the next phase which is, 7:52 yeah, here's one for you. 7:58 One for you, sir. 8:00 There's the new color/? 8:02 there. 8:06 So essentially what we're gonna do is once I get all 8:09 set up, we're just gonna go through like really basically, like prototyping 8:12 [MUSIC] 8:17 This is a very basic entry level project. 8:18 there'll be an LED, there'll be an 8:20 ultrasonic sensor as you saw in some slides. 8:21 And we'll see if what we can get, get them to have it do on stage. 8:24 [MUSIC] 8:26 [MUSIC] 9:02 [MUSIC] 9:20 [INAUDIBLE]. 9:35 >> Well, the cool thing is that, I [INAUDIBLE]. 9:40 >> [INAUDIBLE] So I'm good to go? 9:43 >> You should be good to go. 9:46 >> [INAUDIBLE] >> Great. 9:49 So, you ready to go as well? 9:52 >> Yes. 9:53 >> Okay. 9:55 So our participants are ready. 9:57 So that brings us to phase two, which is taking a look at the actual wiring. 10:01 This is a program. 10:07 That I've become very fond of. 10:08 It's called fritzing and if you have any 10:09 interest in this stuff it's super helpful to kind 10:11 of keep track of where you were in the circuit, kind of map it out in your mind. 10:13 It does a lot of tracing for you as well. 10:17 But the idea here is you two will take 10:22 your wires and reproduce what I've drawn right here. 10:25 On the bread board which, you can see in front 10:28 of you, or to either side of you I guess. 10:31 Is that me? 10:33 Okay. 10:34 [MUSIC] 10:35 [MUSIC] 10:47 And it's nice to have a crowd slowly amassing as things are progressing. 10:51 Maybe that's the way that we'll be doing it. 10:56 But before the end, we have another 38 minutes. 10:57 Hopefully we'll before the end you'll all be up here, so it seems inevitable. 11:00 You might as well just get it over right now and just kind of come up. 11:05 Okay, yeah, you. 11:08 Yes. 11:10 Thank 11:11 you. 11:13 Just grab a chair, bring whatever. 11:14 We were gonna have like fog machines and haze generators and strobe lights. 11:15 Fell off the track. 11:21 I've heard that before. 11:23 That's what happened to my drum too. 11:24 [LAUGH] Yeah, yeah. 11:26 So you're welcome to sit, you're also welcome to just kind of crowd around 11:30 and, you know, kind of intimidate them as they try to get their work done. 11:34 [MUSIC] 11:38 So, to explain how this works we have. 11:48 A blue rail across the very top. 11:51 And we have a red rail, just below that. 11:53 And that represents, positive and negative. 11:55 I said that backwards. 11:57 The blue is negative, and the red is positive. 11:59 And so you'll see, at, at the sight of 12:02 Aduino, it's, it's, it's very, very hard to read. 12:04 but, the, the third pin down, or the fourth pin down. 12:08 Let's see. 12:10 [MUSIC] 12:11 Yeah. 12:15 Third pin down on these guys is five volts. 12:16 That's a very important aspect is that you bring 12:18 five volts onto your bread board rather than three. 12:19 And then ground is the, the last and the second to last on that same header. 12:21 [MUSIC] 12:27 And by pinning this out what you're 12:29 doing is, you're providing electricity to that entire 12:31 row, if you, if you notice when I click here, I see yellow and that's 12:34 basically fritzing telling me, hey all those 12:38 pins are connected, the same thing happens down 12:40 here if I click on one of these rows are also all connected as well 12:43 [MUSIC] 12:47 >> It's like the second to last one on that [UNKNOWN]. 12:56 Does that make sense? 13:01 >> [UNKNOWN] >> Perfect. 13:02 Awesome. 13:04 Awesome, so as you can see, that was insanely fast. 13:05 These guys got two pins hooked up to their bread/? 13:10 board in like, what, three or four minutes. 13:12 And both of these guys from what 13:14 I understand are fairly unfamiliar with hardware hacking. 13:16 So, step one was super easy. 13:20 Let's move on to step two, just draw the rest of the owl. 13:22 So step two. 13:26 As you can see is also quite simple. 13:27 We've only added maybe one or two additional wires. 13:31 But that's where we're going with this. 13:36 So let's step back just a little bit. 13:40 [LAUGH] 13:42 So let's step back a little bit and let's see. 13:45 What what'd be the simplest thing that we could do. 13:46 Right now. 13:49 With what we have on the table, we have an LED. 13:50 We have an ultrasonic sensor. 13:52 Any ideas from the audience? 13:55 What would be, like, the simplest thing that we could get started with? 13:56 You. 14:04 >> [INAUDIBLE] >> That is an amazing idea. 14:04 So let's start with that. 14:05 Let's get an LED out. 14:07 And we'll put it on the red board and 14:09 I will follow along virtually right here on my computer. 14:11 And drop this guy right here. 14:19 And one thing to note about LED's. 14:24 I'll let you plug them in first and then figure it out. 14:27 One thing to note about LED's is that. 14:29 They have a flat side on them. 14:31 And that indicates the polarity. 14:33 And light emitting diodes, being diodes, only 14:35 allow electricity to flow in one direction. 14:37 So the flat side, that you can feel as 14:39 you're holding the actual package, is the negative side. 14:41 And that's the side of it that needs to be attached 14:44 to your negative rail at the very top of your breadboard. 14:46 So, I'll go ahead and do that now 14:49 [MUSIC] 14:50 We'll color the wire just so it's obvious. 14:59 [MUSIC] 15:01 Perfect. 15:14 You see how exciting this is guys. 15:14 [MUSIC] 15:17 This is like, this is amazing stuff. 15:17 So now what we're gonna do is we're gonna hook the LED up to voltage. 15:20 There's only one small problem though. 15:25 Our Arduino provides up to five volts of voltage, 15:26 and the LED's are rated for like two or three. 15:29 So thus we must introduce the complexity of a resistor. 15:35 [MUSIC] 15:38 And for the sake of not really explaining all of the complex math that 15:39 I don't really even hardly understand, I'm just gonna tell you what value to use. 15:43 And that's 220M, it's approximately a 220M resister, 15:47 and what you're gonna do is you're gonna 15:50 take that resister and you're gonna use that 15:51 as a source to provide power to the LED. 15:53 E-D. 15:57 So we do that by just plugging one end on 15:59 the same row of pins the LED is plugged into. 16:00 And then you plug, yeah just pull it right off the script. 16:06 [MUSIC] 16:09 So here I am taking a resistor. 16:16 Closing down the bread board, wiring it up to the positive 16:19 [MUSIC] 16:23 How're we doing so far? 16:35 [MUSIC] 16:36 These two gentlemen look like they're having a blast. 16:46 >> Don't they? 16:49 The rest of our, our participation folks here, they seem a little lonely though. 16:50 I mean there's only three of them on stage and how many of you out there. 16:55 [MUSIC] 16:58 David. 17:06 I was gonna bring, like, bubbles, for you guys to blow 17:08 while we do this but then I was like, eh, electronics. 17:10 Like, yeah, maybe, maybe not. 17:14 [MUSIC] 17:15 >> Yes, this guy. 17:19 >> Anyway, where would I pout this resister. 17:21 >> Resister, yes, you are correct. 17:24 You advance to the bonus round. 17:27 So basically what were going to do as now 17:28 as I mentioned here, one side of these is flat. 17:31 You can kind of tell if yu squeeze it with your finger. 17:33 That the negative, it's also the shorter lead. 17:36 So what you're gonna do is you just pluck it down anywhere as long as you know which 17:39 side is which, and then you're gonna put the, 17:42 the resistor you put the resister on the same row. 17:45 So notice how you have them numbered. 17:51 So just put a resister on the same row. 17:54 As one of the leads. 17:59 So like, right, 18:03 right here. 18:06 So 18:06 to explain I can hardly, there you go, there you go, yeah. 18:09 No, to explain each. 18:16 set of five pens is bridged. 18:18 So the letters are bridged. 18:21 The numbers are not. 18:24 It that makes sense. 18:26 I'm probably explaining it in a really complicated way. 18:27 As you see David here has a blue LED that has been illuminated. 18:30 David, how do you feel about that? 18:35 >> Pretty good. 18:38 >> Could David get a round of applause for his efforts. 18:39 [SOUND] Thank you. 18:41 You're very generous as an audience. 18:44 So, 18:47 so I guess David is going to help, I'm sorry I didn't even get your name. 18:50 Rock-o. 18:53 David is actually going to hop, so I'll just stand here. 18:56 [MUSIC] 18:57 So close, yet so far away. 19:11 [LAUGH] Now we've just 19:15 demonstrated big ground. 19:22 It's a very important component in electronics. 19:29 So, favorite text editors. 19:44 Fin, Emax, Sublime, there we go, that's a safe bet. 19:48 So, once. 19:54 We're ready. 19:56 We're going to progress into the software portion. 19:58 Just, just briefly of this, of this presentation. 20:02 And see how we can program them. 20:05 Maybe they'll, maybe they'll flash or light up or, or what not. 20:08 [MUSIC] 20:12 Okay. 20:16 >> [INAUDIBLE]. 20:17 >> Okay, so we're gonna divide real quick. 20:17 So. 20:21 >> Raisins, peanuts, apple juice, vodka martinis. 20:23 >> So you have, [CROSSTALK] so let's see here. 20:28 [MUSIC] 20:32 >> Ha. 21:06 Ta da. 21:06 >> Another round of applause. 21:08 Woo! 21:10 Going a mile a minute here. 21:11 All right. 21:14 So, we have one red LED, one blue LED. 21:15 What should we do next? 21:20 Any ideas from the audience? 21:22 Yes. 21:25 You. 21:25 Oh, you were just. 21:25 Okay. 21:28 Sorry. 21:28 I thought you were raising your hand. 21:28 No? 21:30 No ideas? 21:31 All right. 21:31 I'm gonna throw one out there, then. 21:31 Let's see if we can use software to make it do something more than just stay on. 21:32 So, open your favorite text editor. 21:37 Obviously, we all use Emacs, right? 21:45 So just fire that up, operating system in your operating system. 21:49 So what would you like to do? 21:56 Would you like to try it just from scratch? 21:59 Or do you want to start from kind of a basic starting point? 22:00 How adventurous are you feeling right now? 22:03 Keeping in mind we only have 27 minutes left. 22:05 >> [INAUDIBLE] >> Great, so let's open up one.js in the 22:07 no ha-ha live folder. 22:13 I'm sorry. 22:20 Not really. 22:24 So while they're 22:27 getting it loaded, I'll go ahead and open it up for you. 22:32 We'll take a look at the code. 22:39 Can you guys see that? 22:44 Everyone in the back see that okay? 22:45 Those of you that are paying attention? 22:47 Great. 22:50 So let's go over this ten lines of code real quick. 22:50 Those of you that are familiar with NodeJS, you're familiar 22:54 with require, it's the only requirement we have in this. 22:58 Basically, what we're doing is, we're loading 23:00 Johnny Five library, we're calling it five. 23:02 We're declaring a board and a white variable. 23:04 Then we'll instantiate the board by saying hey, give me a new five board. 23:07 And Johnny five is so fancy and intelligent that it actually just 23:12 goes out on your devices and looks for something that looks like [UNKNOWN]. 23:16 If it finds one it'll attach to it. 23:19 And then we say when the board's ready. 23:22 Let's use some stuff. 23:24 So, we're gonna say, hey, give us a new 23:25 white LED on pen 9, and then make it pulse. 23:27 So, right now, if my participants were to run this, it wouldn't do 23:31 anything because all the LED is hooked up to, is just direct power. 23:34 So what we're gonna do is instead of directly powering 23:38 the LED with the power rail, we're gonna introduce another jumper. 23:42 We're gonna run it from the positive 23:46 lead on the LED to pin 9 on the [UNKNOWN]. 23:53 The LED which is, which is longer. 24:03 Can you guys hear the questions the participants are asking or no? 24:06 Kind of? 24:08 Okay. 24:10 [MUSIC] 24:10 >> [INAUDIBLE] Jump the gun. 24:23 >> Ta da! 24:46 Another round of applause please. 24:48 I don't know, can you, can you guys see this? 24:49 It's now kind of fading in and out. 24:52 This is what's called pulse or whatever. 24:54 So, here we are. 24:57 25 minutes in, we have an LED pulsate. 25:01 Let's see how much further we can go. 25:05 [MUSIC] 25:06 Now we have two fading LEDs. 25:16 Another round of applause. 25:18 Not to cheapen the applause or anything, but 25:21 this is you know, this is intense stuff. 25:23 These guys aren't that familiar with things, they're 25:25 on stage with me, looking like fools with me. 25:27 This is a pretty big deal. 25:29 All right, so what's next. 25:30 Should do you like a button or something? 25:35 Buttons sound cool. 25:37 So there should be, lost amongst the 25:38 rubble there, there should be two momentary switches. 25:40 Technical term. 25:44 Tap switches, button. 25:46 And what you're going to do is you're gonna lay 25:48 that guy down in the middle of your bread board. 25:50 It's, it's kinda particular so I'm gonna show. 25:52 Let me show you right here. 25:55 It's just like that. 25:56 Right in the middle. 25:58 And then you can show Dave. 25:58 I'm 26:00 on the microphone. 26:04 Now we can have, like, commentary. 26:08 But that aids the whole theme of doing it live, right? 26:11 Live commentary. 26:14 Thank you. 26:15 I appreciate that. 26:16 [MUSIC] 26:16 Yeah. 26:26 And so the idea behind this is to kind of bridge it right between the two sets. 26:27 It doesn't really matter, but it helps get it in there nice and firm, 26:32 and it doesn't pop out and make it look like you did it wrong. 26:35 Great. 26:38 So, as you can see here, I'm gonna kind of highlight with my mouse here. 26:39 These components right here, represent that button that you just placed. 26:47 This being the button, these being a lead to pin, 26:52 I think it's pin 8, it's really hard to see. 26:57 So, what we'll want to do is you'll want to connect a lead 27:03 to the leftmost pin on your button, connect that onto your [UNKNOWN] on pin 9. 27:09 >> Wire? 27:14 >> Yeah jumper, lead, wire. 27:17 Any questions from our, from our audience? 27:26 The ones that are paying attention? 27:29 Yeah, it's, it's fantastic software. 27:33 I learned about it from a guy named Rick Waldren, the guy that created Johnny Five. 27:35 And he actually uses it, if you go and you take a look at his 27:41 read me has actually got sketches of everyth, 27:45 every component that you would want to use. 27:49 He's got a read me with fretting diagrams for it. 27:51 Example code. 27:54 You can kinda scroll through here, if my internet's working. 27:56 Which of course it isn't because I'm on stage. 28:01 But there's, take my word for it, or check it out on your computer. 28:04 GitHub.com/rwaldron/johnny-5. 28:08 For those of you that are interested, this is 28:10 kind of a treasure trove of functionality all ready to 28:15 go. 28:20 So, back to this, we've got one 28:21 pin connected, yeah, looks like we've got that. 28:22 Great Dave, you're on the same page. 28:26 Yes. 28:28 Speak into the microphone. 28:29 >> The the LED had one side that was for ground and then 28:35 one that was for power, does the switch also have the same output. 28:38 >> It does not, but that is a great question. 28:41 Switches aren't quite as particular, which is nice, 28:45 they just allow electricity to flow in either direction. 28:48 Now I'm going to pick out another set of resistors of 28:54 very particular resisters, don't question me on this, but pick a 28:57 10K Ohm resistor, and what you are going to do, is 29:01 your gonna hook that up to the other side of that switch. 29:04 So, just like you have right here. 29:08 Right here. 29:11 And that resistor is going to go to ground, which is the blue red. 29:12 Is 29:15 everyone with us so far? 29:18 And questions? 29:19 Any concerns? 29:21 Any comments you'd like to add? 29:23 Yes, you. 29:26 Did you have something to say? 29:27 No, okay. 29:29 >> You might get them eventually with one of those. 29:32 >> Maybe I think so. 29:34 [INAUDIBLE] My eye itched actually, I'm sorry. 29:35 >> You do. 29:38 >> Either that or I'll be really afraid to move at all, I'll just. 29:38 Emily, what's your favorite thing you've ever built with an Arduino. 29:46 >> Oh, oh, Jeez. 29:50 The, my favorite thing that I've built with an Arduino so far has been an 29:51 alarm system that is based on this very 29:55 same Ultrasonic component, but also included Twilio functionality. 29:57 They allowed me to alert the club I was working for, if 30:01 there was motion after hours, we would all get a call to 30:04 be placed into a conference call and decide who gets to go 30:08 take care of it, or go take a look a the surveillance footage. 30:10 Nothing too fancy, but it was really easy and inexpensive, and 30:14 it kind of served the need that we had at the club. 30:17 And that's kind of how I got started doing this. 30:19 Great, so we have the resistor placed almost? 30:24 Okay so and so 30:30 the only other thing 30:35 left to do is to give 30:42 that button power. 30:48 And by giving that button power, what 30:55 you're doing is you're allowing the signal pin 30:57 that we have attached on pin nine to tell the Arduino hey, the button's been pushed. 30:59 So, grab another 31:03 jumper. 31:10 Let me fix this for you. 31:13 Fix this thing for you. 31:19 >> [INAUDIBLE] And then just [INAUDIBLE]. 31:22 >> [INAUDIBLE]. 31:24 >> I got this one here and then 31:26 I don't know where it is. 31:32 >> Has anyone in our illustrious viewing panel 31:40 built something with Arduino or act with no jest. 31:43 >> Just start going now, just start going now. 31:48 And what did you build? 31:49 >> LE Bluetooth low energy device, you know. 31:52 >> To do what? 31:58 How else >> Fry beacons. 32:00 >> Anyone in the audience? 32:06 Everything fun with Arduino and node? 32:09 >> Huh, one back there. 32:13 I'll come find it. 32:14 >> I see how it is. 32:18 [NOISE]. 32:18 >> I did a photo filtering program with push buttons defiltering. 32:25 Just for the fun of it? 32:32 And so how did you go through learning how to do that? 32:36 Did you use [INAUDIBLE]? 32:41 >> I used processing just through their processing interface terminal tool. 32:44 >> So. 32:50 >> College and projects and stuff. 32:50 >> Cool. 32:54 >> So now that our participants have 32:55 hopefully correctly wired the button, we're gonna 33:01 move on to 2.js which adds a little bit more, 17 whopping lines of code. 33:04 And now in addition to instantiating the LED we're also instantiating a button. 33:10 And it also, also just as simple V5 button on pin eight. 33:16 Did we put it on pin eight or did we put it on pin 9? 33:21 I forget. 33:22 >> I believe it was eight. 33:23 >> Great. 33:25 And then right now what we're doing is we're just saying hey, when the 33:26 button gets pushed send the message to the console that says hey, button's pushed. 33:28 So, hopefully the new button 2.js. 33:33 You push the button. 33:38 You should see the message. 33:40 [MUSIC] 33:40 So if it's telling you that the button is pushed continuously, and you 33:49 haven't actually pushed it, probably what happened is you have the leads backwards. 33:52 And that may be my fault, I could have told you to do it the wrong way. 33:57 Excuse me. 34:00 So, 34:01 [MUSIC] 34:01 Yeah, I mean it's great, it's nice to have 34:33 a little private conversation going on, you know, kind of. 34:36 Yeah, yeah, I mean, I'm sure they have conversations going on too, so. 34:40 But really though, 34:44 the only thing we're missing is you know, a bunch of lights. 34:51 >> A contortionist or something. 34:55 >> Yeah, that would be good. 34:58 [MUSIC] 34:59 Yes. 35:04 [CROSSTALK]. 35:07 >> It's not working. 35:09 >> Okay. 35:14 >> [INAUDIBLE] >> This one all the way. 35:15 Maybe [INAUDIBLE] >> Not sure. 35:19 [INAUDIBLE] So is it, do you have it running? 35:23 >> There. 35:37 [INAUDIBLE]. 35:39 >> Here we go. 35:41 We, we were off 35:43 [INAUDIBLE] again. 35:49 [INAUDIBLE] And now. 35:58 So both of our participants have just 36:02 encountered a very common pitfall. 36:09 And that is, because bread boards are composed of 36:16 pretty much of just tons of really tiny holes. 36:19 It's easy to be off by one. 36:21 So, participants were plugging their, their button in but 36:24 the jumpers weren't lining up with the actual leads. 36:28 so, that's pretty common, so they need to keep in mind. 36:31 If you decide that you are so inspired by the display of 36:34 awkward awesomeness that you want to go home start with Arduino right away. 36:37 So you can't see it from there because you're not up here. 36:42 But when our participants pushed the button, their console is 36:46 displaying a string of text, that is mind blowingly awesome. 36:50 So let's see if we can hook that up to LED instead. 36:55 That way the rest of you sitting comfortably in 36:59 your chairs can see when the button is pushed. 37:03 Does anyone have any ideas on how we might do that with code. 37:10 Anyone? 37:12 Yes you, right there, looking at your phone. 37:14 You had an idea on how to connect this properly to an LED? 37:19 Yes. 37:25 Yeah? 37:27 Yeah, come on up and show us. 37:27 You'll be great. 37:30 I'm gonna have a lot of people to apologize after this, 37:34 so. 37:42 So, yeah, so what we're doing right now is we are, we, we 37:42 have a button that's functioning and it, and it's emitting text to the console. 37:44 But now we need to get it, to light the LED up when we push the button. 37:49 And it seems like maybe you had. 37:53 >> Going through the code to do it? 37:54 >> Yes, yeah, through the code. 37:55 So here's where we're at right 37:57 now. 38:01 And so all it does is is the console logs. 38:02 But really what we want to do is we want to turn the LED 38:05 on and then we want to turn the LED off when they push the button. 38:07 You could do a a case, case switch which would take care of it so you do a switch. 38:09 Case zero, case one would be on and off. 38:17 >> It's perfect. 38:20 >> All right, thank you so much. 38:21 That was that was helpful. 38:25 So basically what we're gonna do is not at all that. 38:26 I'm sorry, that was a great idea, but 38:31 we're gonna do it a little bit differently. 38:33 Yeah, no once you come up you cannot leave. 38:35 No you can leave it's fine. 38:38 But you can take a start sticker if you want. 38:39 Okay. 38:42 Forgive me for a second here. 38:45 Blue, blue yeah. 38:48 Okay, so what are we gonna do. 38:50 >> I see you guys are, yeah, you're doing some guesses. 38:55 That's great. 38:59 I mean, no pressure or anything, but we only have ten minutes left. 39:01 So. 39:10 >> The API [INAUDIBLE]. 39:11 >> That is a great question. 39:15 Maybe we should try it and see. 39:17 So digitarial actually loaded from the last time I was 39:23 showing you this. 39:32 We'll take a look at the API for, for LEDs. 39:33 Give our participants something 39:37 to go off of. 39:43 Now I don't know if you guys saw what just happened, 39:47 but Rocco just got a button lighting up in LED. 39:53 Is that worth a round of applause, or are we tired of, of applauding? 39:58 [APPLAUSE] That is fantastic, so, we have nine minutes left, let's see 40:01 if we can hook up an ultrasonic sensor, that's pretty simple, right. 40:06 >> It sounds very simple. 40:13 >> Oh, yeah, I mean it's, you know, 40:14 just sounds waves and, electricity,it could go wrong. 40:16 So, Oops, here is a documentation for the 40:22 pink sensors, here's how you hook it up 40:27 [MUSIC] 40:32 [LAUGH] so yours is yours is right here, and 40:39 okay [INAUDIBLE] what's more difficult, 40:44 finding the code for this stuff, or 40:50 coming up with it, or actually getting 40:55 those little pins into the proper leads. 41:00 >> Yeah, it's definitely the, the little pins, yeah, the 41:06 thing about hardware is that it's kinda hard like you know- 41:08 [UNKNOWN] 41:11 >> Yeah, I mean, and when it comes to software, like you know, we're, all of us 41:12 as developers are pretty familiar with software, It's easy 41:16 to debug software, but how do you debug hardware. 41:19 That's, you know, generally speaking the most you get when your hardware's not 41:21 working is a beep code or and LED is flashing or nothing works. 41:25 >> Smoke monsters. 41:29 >> Other than smashing it in rage, what's the best way to 41:32 >> In my experience, the best way to 41:36 address those types of unsolvable bugs is just to 41:37 walk away for a little bit, and then come 41:40 back and generally, you know, after a couple retries 41:42 like that you'll just be like, oh duh, it was the wrong pin or the wrong hole, or 41:46 just whatever, right so yeah, it's one of those 41:50 things where there's no substitute for experience when it 41:54 comes to hardware and that sort of stuff. 41:57 But you know, the software stuff is great, 41:58 like very basic, straight forward, I mean originally 42:01 I was gonna do this demo in like 42:04 assembly, but I was worried that it wouldn't register. 42:08 And then I thought maybe we could do like C plus, plus, and 42:12 when it comes to C plus, plus like I still need, you know, pointers. 42:15 So, java script it is and java script is 42:18 such serious business, you can't make jokes about that. 42:22 >> No. 42:24 >> No, 42:24 [MUSIC] 42:24 So, where are our participants at, do we have 42:27 things pinned properly, am I showing the wrong screen? 42:30 [MUSIC] 42:34 Six minutes, gentlemen, the pressure is on, Is the 42:40 audience feeling pressured or just bored, you say bored? 42:44 >> Here's what I'm looking forward to. 42:48 >> Yeah. 42:50 >> When you get that sensor plugged in and they clap. 42:50 >> Oh yeah. 42:53 >> The light's gonna turn on. 42:54 >> For like the 12th time, yeah. 42:55 >> But, they'll be doing it this time. 42:57 >> Oh yeah. 43:01 >> Mm-hm. 43:02 >> There we go yeah, we'll bring everyone up and, and 43:02 wave their hands in front of it and, it'll work and, okay. 43:05 That's how we'll do it, okay. 43:09 >> So. 43:12 >> Sorry. 43:13 >> Does this go anywhere, or? 43:15 >> Yes, so basically we take a look here, you've got [INAUDIBLE] got sugar 43:17 and [UNKNOWN] so you plug that in, and you wanna take what [INAUDIBLE]. 43:23 >> seven. 43:29 >> [INAUDIBLE] seven. 43:30 [MUSIC] 43:30 [INAUDIBLE] Either 43:32 one and the reason 43:37 behind that [UNKNOWN] 43:43 on a [INAUDIBLE]. 43:49 >> Completely unrelated note I'd like to announce that 43:54 the Chinese philosopher Confucius has just followed me on Twitter. 43:56 He may have died in 479 B.C. but he did just 44:00 follow me, because probably cuz I shouted out, Jesse Cravens' Confucius quote. 44:03 Earlier today, but being followed from the beyond the 44:09 grave by Confucius pretty much has made my day. 44:13 [MUSIC] 44:17 >> That was smarter, I did them all in the front. 44:21 >> Mm-hm. 44:24 >> Yeah, that could be difficult, that looks nice though, yeah. 44:25 So, gotta it wired up properly the next step is to just move on to three.js. 44:31 And so I'll, I'll show the audience that as well, 44:38 and yet again, we've added a little bit 44:44 so, we're up to 24 lines of code. 44:49 And again this is just a console logging 44:51 some values but all we've added is ping equals 44:55 new five.ping on pin seven and we say, 44:58 hey, when the ping changes, let us know and 45:01 it'll either have an error object or a 45:04 value which is the raw value of the distance 45:06 that it measured and the really cool thing is 45:08 you can actually just type, as per the documentation. 45:11 You can just use this dot inches, and then it also just 45:16 has this.centimeters and it actually will tell you no, no calculation required how 45:19 far away the nearest object is, but if all we're really interested 45:23 in is, is change events, that's all we really have to worry about. 45:26 And, the code here that, that I'm demoing is, you know, it's a 45:31 very pared down essential version of what i kind of wrote for, for the 45:35 club that I was working and, and this went into production as an 45:39 alarm system and it worked pretty well, so we'll see what we can do. 45:43 [MUSIC] 45:47 [UNKNOWN] So we just had the question now 45:50 what is the range on these sensors, 45:56 and in my experience it's maybe 46:01 15, 16 feet of accuracy. 46:06 And then you get, kind of, some hit and miss in there as well for those of 46:11 you slightly unrelated, but for those of you who 46:15 are familiar with, like the Perrot AR drone, or 46:17 Perrot AR drone this is the very same type of sensor that's in the bottom of those 46:19 drones, that help it with knowing how high away, 46:23 or how far away it is from the ground. 46:25 So, you may not be able to tell just yet, the Rockwell over here 46:28 has his censer working, with only two and half minutes left in the game. 46:33 So, for those of you that have any interest left 46:38 at all, if you, you're welcome to come up and 46:41 take a look at what he has ended up with 46:44 obviously things went a little bit rockier than what I expected. 46:46 Audience's maybe just a little bit less willing to participate 46:50 then I had expected, but that's okay, I'll forgive you. 46:53 But all in all, I think we did pretty well 46:56 these guys seemed to have fun, our, our audience members, 46:59 our, our observers, definitely had a lot of fun standing, 47:03 sitting here, staring at the back of these gentlemen's heads. 47:08 So that was great in closing, I would like 47:11 to open up to any additional questions that you may 47:14 have and If you have anything else you would like 47:18 to say, I will be available, for hallway track questions. 47:21 >> Let’s give everybody up on stage, other than me, a round of applause. 47:25 [APPLAUSE]. 47:33 I had fun and I don't know how any of this works so It's great all 47:36 right so we've got let's see Matt Ruby coming up next I think. 47:42 >> Do we, do we have time for me to clean up all this mess? 47:47 >> I think we probably do. 47:50 >> Well, thank you all for, for humoring me, It was 47:52 a lot of fun making a fool of myself on stage. 47:54 [CROSSTALK]. 47:57 >> With all these folks and like I said, 47:57 if you have questions or yeah, you wanna talk 47:58 or you wanna borrow some hardware and, and get 48:00 hacking, I'm happy to help out, so thank you again. 48:02 [APPLAUSE] 48:05
You need to sign up for Treehouse in order to download course files.Sign up