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