5. HARDWARE HACKING; WAT?
• We
take electronics and bend them to our will
• Can
use any component, as long as it can be soldered
6. HARDWARE HACKING; WAT?
• We
take electronics and bend them to our will
• Can
use any component, as long as it can be soldered
•A
variety of levels of difficulty and accessibility
13. HARDWARE HACKING; HOW?
•A
basic knowledge of electronics is definitely helpful
• Skills
such as soldering and stripping wires
14. HARDWARE HACKING; HOW?
•A
basic knowledge of electronics is definitely helpful
• Skills
such as soldering and stripping wires
• GPIO
pins; GPIO pins everywhere!
15. HARDWARE HACKING; HOW?
•A
basic knowledge of electronics is definitely helpful
• Skills
such as soldering and stripping wires
• GPIO
• No
pins; GPIO pins everywhere!
'correct' or 'right' way
16. HARDWARE HACKING; HOW?
•A
basic knowledge of electronics is definitely helpful
• Skills
such as soldering and stripping wires
• GPIO
• No
• Be
pins; GPIO pins everywhere!
'correct' or 'right' way
safe and have respect for electricity
19. HARDWARE HACKING; WHEN?
• Creating
• Using
projects to react solely to electricity
timing chips, resistors and circuit boards
20. HARDWARE HACKING; WHEN?
• Creating
• Using
projects to react solely to electricity
timing chips, resistors and circuit boards
• Programmable
micro controllers
21. HARDWARE HACKING; WHEN?
• Creating
• Using
projects to react solely to electricity
timing chips, resistors and circuit boards
• Programmable
micro-controllers
• Micro-controllers
on an integrated platform
34. LITTLE BITS; A BIT USEFUL?
• Extremely
Modular
• Incredibly
Hands On
35. LITTLE BITS; A BIT USEFUL?
• Extremely
Modular
• Incredibly
Hands On
• Makes
exploring hardware
simple and fun
36. LITTLE BITS; A BIT USEFUL?
• Extremely
Modular
• Incredibly
Hands On
• Makes
exploring hardware
simple and fun
• Best
for proof of concepts and
toying with new ideas
54. ARDUINO; OPEN SOURCE
MEANS OPEN OPTIONS
• Arduino
UNO
• Arduino
Mega
• Arduino
Lilypad
• Open
Source; can be
reproduced by anybody with
the right components
56. ARDUINO; HOW TO CODE
• IDE
based on translating
simple code to C++
57. ARDUINO; HOW TO CODE
• IDE
based on translating
simple code to C++
• BreakoutJS; Javascript
Browser interactivity
and Web
58. ARDUINO; HOW TO CODE
• IDE
based on translating
simple code to C++
• BreakoutJS; Javascript
and Web
Browser interactivity
• Johnny
Five; Node based
framework
63. RASPBERRY PI; TASTY!
•A
computer (and then some)
• GPIO
pins
• Has
all the hardware needed
for a computer onboard
• Runs
a boatload of operating
systems
64. RASPBERRY PI; TASTY!
•A
computer (and then some)
• GPIO
pins
• Has
all the hardware needed
for a computer onboard
• Runs
a boatload of operating
systems
• GPIO
pins are easily
addressable
88. RASPBERRY PI; WHY?
• More
Processing Power
• Onboard
Storage
• Freedom
of Language Choice
89. RASPBERRY PI; WHY?
• More
Processing Power
• Onboard
Storage
• Freedom
of Language Choice
• Easily
configured Internet
Access
90. RASPBERRY PI; WHY?
• More
Processing Power
• Onboard
Storage
• Freedom
of Language Choice
• Easily
configured Internet
Access
• Runs
any code you write for it
on the board instead of
tethered to a computer
92. RASPBERRY PI; WHY NOT?
• Less
battery life than an
Arduino
• Can
be cumbersome to set up
and program
93. RASPBERRY PI; WHY NOT?
• Less
battery life than an
Arduino
• Can
be cumbersome to set up
and program
• Doesn’t
have as much of a
support for shields
97. SHIELDS?
• Pre
created circuit boards that extend functionality
• Can
use multiple shields at once ...
• ... though
like using multiple of anything at once, take care.
99. NODE; WHAT IS IT?
•A
familiar flavour of Javascript; people already know it!
100. NODE; WHAT IS IT?
•A
familiar flavour of Javascript; people already know it!
• Non
Blocking I/O
101. NODE; WHAT IS IT?
•A
familiar flavour of Javascript; people already know it!
• Non
Blocking I/O
• Event
Driven using callbacks
102. NODE; WHAT IS IT?
•A
familiar flavour of Javascript; people already know it!
• Non
Blocking I/O
• Event
Driven using callbacks
• Operating
System Agnostic (mostly)
104. NODE; WHY IS IT COOL?
• Incorporates
Google’s V8 Engine for speed
105. NODE; WHY IS IT COOL?
• Incorporates
• Has
Google’s V8 Engine for speed
some really fun functions
106. NODE; WHY IS IT COOL?
• Incorporates
• Has
Google’s V8 Engine for speed
some really fun functions
• Crypto, OS, FS
107. NODE; WHY IS IT COOL?
• Incorporates
• Has
•
Google’s V8 Engine for speed
some really fun functions
Crypto, OS, FS
• Has
a massive amount of external libraries to augment it
108. NODE; WHY IS IT COOL?
• Incorporates
• Has
•
some really fun functions
Crypto, OS, FS
• Has
•A
Google’s V8 Engine for speed
a massive amount of external libraries to augment it
server side language front end developers can write!
110. NODE; HOW TO INSTALL?
LINUX
> wget http://nodejs.org/dist/v.0.8.11/nodev0.8.11.tar.gz
>
>
>
>
>
tar -zxf node-v0.8.11.tar.gz
cd node-v0.8.11
./configure
make
sudo make install
112. NODE; HOW TO INSTALL?
MAC & WINDOWS
• Much
more simple and straightforward than Linux
113. NODE; HOW TO INSTALL?
MAC & WINDOWS
• Much
more simple and straightforward than Linux
• Go
get the installer from nodejs.org/download/
114. NODE; HOW TO INSTALL?
MAC & WINDOWS
• Much
more simple and straightforward than Linux
• Go
get the installer from nodejs.org/download/
• No, really. Download
it from there and install it. Job done.
115. NODE; HOW TO INSTALL?
MAC & WINDOWS
• Much
more simple and straightforward than Linux
• Go
get the installer from nodejs.org/download/
• No, really. Download
it from there and install it. Job done.
123. NPM;
NOT PROBLEMATIC, MOSTLY
• Nodes
inbuilt library management tool
• Has
its own website listing all of the modules
• Makes
it incredibly easy to install modules
126. NPM; HOW TO USE
• It
all starts with npm
• Different
Keywords; https://npmjs.org/docs
127. NPM; HOW TO USE
• It
all starts with npm
• Different
• Most
Keywords; https://npmjs.org/docs
useful are install and update
128. NPM; HOW TO USE
• It
all starts with npm
• Different
Keywords; https://npmjs.org/docs
• Most
useful are install and update
• npm
install || npm update
130. NPM; INSTALLING A MODULE
• Find
the package you want to install on the npm site
131. NPM; INSTALLING A MODULE
• Find
the package you want to install on the npm site
• Run
npm install gpio to install the package
132. NPM; INSTALLING A MODULE
• Find
the package you want to install on the npm site
• Run
npm install gpio to install the package
• -g
flag installs globally instead of locally for command line use
133. NPM; INSTALLING A MODULE
• Find
the package you want to install on the npm site
• Run
npm install gpio to install the package
• -g
flag installs globally instead of locally for command line use
• require(“gpio”);
in your project
134. NPM; INSTALLING A MODULE
• Find
the package you want to install on the npm site
• Run
npm install gpio to install the package
• -g
flag installs globally instead of locally for command line use
• require(“gpio”);
• npm
in your project
packages need to be installed in each project’s folder you
intend to use them in
148. CUTTING IN TO THE PI
• First
off, we install Adafruit’s Occidentalis distribution
149. CUTTING IN TO THE PI
• First
off, we install Adafruit’s Occidentalis distribution
• We
SSH in to the Raspberry Pi
150. CUTTING IN TO THE PI
• First
off, we install Adafruit’s Occidentalis distribution
• We
SSH in to the Raspberry Pi
• We
connect it to a monitor with keyboard and mouse
153. CUTTING IN TO THE PI; SSH
• Power
• Plug
it up!
an Ethernet cable in to your Pi and your Router
154. CUTTING IN TO THE PI; SSH
• Power
• Plug
• Run
it up!
an Ethernet cable in to your Pi and your Router
ssh raspberrypi.local on your computer to get
to the Pi
155. CUTTING IN TO THE PI; SSH
• Power
• Plug
it up!
an Ethernet cable in to your Pi and your Router
• Run
ssh raspberrypi.local on your computer to get
to the Pi
• Alternatively
log in to your router and get the IP of the Pi from
there; ssh pi@<ip_of_pi> . Use the password
“raspberry”
159. CUTTING THE PI LOOSE
• Run
sudo nano /etc/
network/interfaces
160. CUTTING THE PI LOOSE
• Run
sudo nano /etc/
network/interfaces
• Delete
file
the contents of the
161. CUTTING THE PI LOOSE
> auto lo
> iface lo inet loopback
> iface eth0 inet dhcp
> allow-hotplug wlan0
> auto wlan0
> iface wlan0 inet dhcp
> wpa-ssid "ssid"
> wpa-psk "password"
• Run
sudo nano /etc/
network/interfaces
• Delete
the contents of the
file
• <-
Replace it with this
162. CUTTING THE PI LOOSE
> auto lo
> iface lo inet loopback
> iface eth0 inet dhcp
> allow-hotplug wlan0
> auto wlan0
• Run
sudo nano /etc/
network/interfaces
• Delete
the contents of the
file
• <-
> iface wlan0 inet dhcp
> wpa-ssid "ssid"
> wpa-psk "password"
• Replace
Replace it with this
SSID and
PASSWORD
170. BLOWING RASPBERRIES;
MAKING A LIGHT BLINK
GPIO
>Var strobeTimer =
setInterval(function() {
> gpio4.set();
>
setTimeout(
>
function(){
>
gpio4.reset();
>
}, 200);
>
}, 400);
>/*Can also pass a number in to >the
>set function.*/
171. BLOWING RASPBERRIES;
MAKING A LIGHT BLINK
GPIO
Johnny-Five
> /* Create a standard `led`
>hardware instance*/
> Var led = new five.Led(13);
>
> /* "strobe" the led in 100ms
>on-off phases*/
> led.strobe( 100 );
>Var strobeTimer =
setInterval(function() {
> gpio4.set();
>
setTimeout(
>
function(){
>
gpio4.reset();
>
}, 200);
>
}, 400);
>/*Can also pass a number in to >the
>set function.*/
177. BLOWING RASPBERRIES;
SETTING VALUES
GPIO
> gpio4.set(function()
>{ console.log(gpio4.value);
>});
Johnny-Five
Nothing explicit; is accomplished by passing
values straight in to the functions
178. FINAL HINTS AND TIPS
• Once
client
connected so you can SSH in to it, use a file transfer
179. FINAL HINTS AND TIPS
• Once
connected so you can SSH in to it, use a file transfer
client
• Helpful
the PI
if the GPIO pins are labeled using the paper overlay for
180. FINAL HINTS AND TIPS
• Once
connected so you can SSH in to it, use a file transfer
client
• Helpful
if the GPIO pins are labeled using the paper overlay
for the PI
• Get
a ribbon cord for the Pi; will make your life easier.
181. HE’S STILL NOT FINISHED?
• Not
everything has to be written in NodeJS
182. HE’S STILL NOT FINISHED?
• Not
everything has to be written in NodeJS
• Is, however, an
developers
accessible starting point for front end
183. HE’S STILL NOT FINISHED?
• Not
everything has to be written in NodeJS
• Is, however, an
accessible starting point for front end
developers
• Projects
don’t need to be in the same language
184. HE’S STILL NOT FINISHED?
• Not
everything has to be written in NodeJS
• Is, however, an
accessible starting point for front end
developers
• Projects
don’t need to be in the same language
• Important
that what you’ve written works
185. MAYBE HE NEARLY IS?
• Don’t
be afraid; there’s always help at hand!
186. MAYBE HE NEARLY IS?
• Don’t
be afraid; there’s always help at hand!
• Don’t
expect to not learn anything during the project!
187. MAYBE HE NEARLY IS?
• Don’t
be afraid; there’s always help at hand!
• Don’t
expect to not learn anything during the project!
• Have
fun with your project!
188. MAYBE HE NEARLY IS?
• Don’t
be afraid; there’s always help at hand!
• Don’t
expect to not learn anything during the project!
• Have
fun with your project!
• Be
Careful!