Skip to content

Commit

Permalink
Formatting for Createspace
Browse files Browse the repository at this point in the history
  • Loading branch information
olasitarska committed Apr 25, 2014
1 parent 2c38f3f commit 478819b
Show file tree
Hide file tree
Showing 21 changed files with 2,787 additions and 2,565 deletions.
Binary file added 90%
Binary file not shown.
5,254 changes: 2,730 additions & 2,524 deletions content/cover.ai

Large diffs are not rendered by default.

Binary file added content/workshops/3dmodeling/image00-0.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/workshops/3dmodeling/image00-1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/workshops/3dmodeling/image00.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/workshops/3dmodeling/image03.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 11 additions & 8 deletions content/workshops/c_pythonruby.md
Expand Up @@ -166,8 +166,9 @@ But this is child's play. Lets try something more advanced.

First thing before writing code is to connect HC-SR04 ultrasonic ranging module with Arduino. Grab your breadboard, some cables and connect them like this:

![Sonar](content/workshops/pythonruby/3_sonar_bb.jpg)
\newpage

![Sonar](content/workshops/pythonruby/3_sonar_bb.jpg)

Colors are not important, but be concise when using them. This way you won’t make silly mistakes like connecting wrong wire to wrong hole.

Expand Down Expand Up @@ -198,8 +199,6 @@ But firstly the wires. Lets start with DHT11 (don’t disconnect the sonar, it w

![](content/workshops/pythonruby/4_meteo_dht_bb.jpg)

\newpage

Now connect VCNL4000:

![](content/workshops/pythonruby/4_meteo_vcnl_bb.jpg)
Expand Down Expand Up @@ -247,15 +246,15 @@ Other quirk of this sensor is long lag after detecting motion. There’s potenti

Connect the wires like this:

![HC-SR501](content/workshops/pythonruby/5_alarm_bb.jpg)
![](content/workshops/pythonruby/5_alarm_bb.jpg) \

Your PIR may have wires with different colors or don’t have wires at all, so just hold it like in the picture above and number pins from left to right.

Supporting code is easy as pie:

# Use motion sensor
serial.write("M")
# After first start, sensor needs about 15 seconds to calibrate, just wait for it
# After first start sensor needs 15 seconds to calibrate, just wait
serial.readline()
# Loop
while True:
Expand All @@ -281,6 +280,8 @@ Now you know how to use all the sensors, you can use it to create a beautiful we

To make it easier, we’ve prepared custom dashboard using Dashing: <http://shopify.github.io/dashing/>. It’s super easy to set up and host i.e. on Heroku. Our dashboard looks like this:

\newpage

![](content/workshops/pythonruby/dashboard.jpg)

To send data to this dashboard you need to know which ID to use. It should be written on a sticker on your Arduino. If you’re not at Makerland, just use `arduino-X` where X is number from 1 to 20.
Expand Down Expand Up @@ -382,6 +383,8 @@ You’ve just used your code to play with something already built, lets get to s

Before you write anything lets have fun with wires. Grab HC-SR04 ultrasonic ranging module, Arduino, your breadboard, some wires and connect them all together this way:

\newpage

![Sonar_rb](content/workshops/pythonruby/3_sonar_bb.jpg)

You don’t have to use the same colors as we do, but be meticulous while using them. By doing so you will avoid mistakes like connecting ground pin from module to Arduino power pin.
Expand Down Expand Up @@ -414,8 +417,6 @@ Start with the wires. Don’t disconnect sonar, it will be required late. First

![DHT11](content/workshops/pythonruby/4_meteo_dht_bb.jpg)

\newpage

Now connect VCNL4000:

![VCNL4000](content/workshops/pythonruby/4_meteo_vcnl_bb.jpg)
Expand All @@ -424,7 +425,7 @@ Now connect VCNL4000:

Now in Ruby shell:

# You have reconnected your Arduino, so you have to initialize serial port again
# You have reconnected your Arduino, initialize serial port again
serial = SerialPort.new("YOUR_SERIAL_PORT", 9600, 8, 1)
# Loop
loop do
Expand Down Expand Up @@ -462,6 +463,8 @@ There is one sensor left: HC-SR501 PIR motion detector. Based on infrared light,

Connect wires this way:

\newpage

![](content/workshops/pythonruby/5_alarm_bb.jpg)

Be sure to hold it like on the picture, so you won’t connect it in the wrong way.
Expand Down
2 changes: 0 additions & 2 deletions content/workshops/d_soldering.md
Expand Up @@ -22,8 +22,6 @@ __Szymon Kubicki__ is a power electronics engineer and a follower of Lean Hardwa

# Soldier, wire, glue!

![](content/workshops/soldering/17.jpg)

## Overview

Imagine your Arduino or RaspberryPi. Imagine you are building your dream project and there comes a moment when you have to compromise with the device's functionalities because you have run out of ports in the microcontroller.
Expand Down
7 changes: 2 additions & 5 deletions content/workshops/e_firmata.md
Expand Up @@ -2,10 +2,6 @@
\thispagestyle{empty}
\mbox{}

\newpage
\thispagestyle{empty}
\mbox{}


\newpage

Expand Down Expand Up @@ -194,7 +190,8 @@ Our new button object has methods like “down”, “up”, and “hold”, whi

button.hold(play_some_sound)

When ever someone presses and holds the button down, a function called “play_some_sound” is called.
When ever someone presses and holds the button down, a function called
`play some sound` is called.

Now write a program that prints out “Button Pressed” whenever someone presses your button.

Expand Down
19 changes: 13 additions & 6 deletions content/workshops/g_drones.md
Expand Up @@ -2,6 +2,10 @@
\thispagestyle{empty}
\mbox{}

\newpage
\thispagestyle{empty}
\mbox{}

\newpage

![](content/workshop_images/drones.jpg)
Expand Down Expand Up @@ -32,7 +36,8 @@ We'll start writing basic programs to take off and land, and before you know it

First, if you’ve not already played with an AR Drone before then download the FreeFlight app for your iOS or Android device and take one of the drones for a flight:

* Plug in the battery of your drone <https://www.youtube.com/watch?v=QdFsd9R3vJ8#t=25s>
* Plug in the battery of your drone:
* <https://www.youtube.com/watch?v=QdFsd9R3vJ8#t=25s>
* Connect your device to the wifi labeled on the drone, i.e. D1
* Open the FreeFlight app and tap “Piloting”
* Hit "Takeoff" and enjoy flying your robot around the room
Expand Down Expand Up @@ -362,10 +367,11 @@ Now we have data that we can use to display what is happening inside the drone,
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io.connect('http://localhost:8080');
socket.on('navdata', function (data) {
document.getElementById("battery").innerHTML = data.demo.batteryPercentage;
});
var socket = io.connect('http://localhost:8080');
socket.on('navdata', function (data) {
var $battery = document.getElementById("battery").innerHTML;
$battery = data.demo.batteryPercentage;
});
</script>
</head>
Expand Down Expand Up @@ -469,4 +475,5 @@ Try out some of these more advanced nodecopter projects:

- Nodecopter website - <http://nodecopter.com/hack>
- Nodecopter modules on NPM - <https://npmjs.org/browse/keyword/nodecopter>
- AR Drone SDK documentation: <https://projects.ardrone.org/projects/show/ardrone-api>
- AR Drone SDK documentation -
- <https://projects.ardrone.org/projects/show/ardrone-api>
6 changes: 2 additions & 4 deletions content/workshops/h_home.md
@@ -1,6 +1,3 @@
\newpage
\thispagestyle{empty}
\mbox{}

\newpage
\thispagestyle{empty}
Expand Down Expand Up @@ -341,7 +338,8 @@ In the block for a verified number, we can now add the handler to send and respo

~~~~ {.numberLines}
serialPort.once('data', function(data) {
if (data.toString().indexOf('U') > -1) { //check if the Arduino returned a U for unlocking
//check if the Arduino returned a U for unlocking:
if (data.toString().indexOf('U') > -1) {
sendMessage(res, 'Unlocking!');
}
else if (data.toString().indexOf('L') > -1) {
Expand Down
Binary file modified content/workshops/home/image08.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 18 additions & 9 deletions content/workshops/i_lilypad.md
Expand Up @@ -2,6 +2,10 @@
\thispagestyle{empty}
\mbox{}

\newpage
\thispagestyle{empty}
\mbox{}

\newpage

![](content/workshop_images/lilypad.jpg)
Expand Down Expand Up @@ -37,8 +41,6 @@ or Arduino LilyPad USB and micro USB cable

![](content/workshops/lilypad/2.jpg) \

\newpage

Battery Holder and Cell batery

![](content/workshops/lilypad/3.jpg) \ ![](content/workshops/lilypad/4.jpg)
Expand Down Expand Up @@ -221,10 +223,12 @@ Generates a tone (square wave) on the provided `speakerPin`.
The tone will last for `timeInMilliseconds` and have the `frequencyInHertz`.

~~~~ {.numberLines}
void beep (unsigned char speakerPin, int frequencyInHertz, long timeInMilliseconds) {
void beep (unsigned char speakerPin, int frequencyInHertz,
long timeInMilliseconds) {
int x;
long halfCycleDelay = (long) (1000000 / frequencyInHertz / 2);
long cycleRepeats = (long) ((timeInMilliseconds * 1000) / (halfCycleDelay * 2));
long cycleRepeats = (long) ((timeInMilliseconds * 1000);
cycleRepeats = cycleRepeats / (halfCycleDelay * 2));
for (x = 0; x < cycleRepeats; x++) {
digitalWrite(speakerPin,HIGH);
delayMicroseconds(halfCycleDelay);
Expand Down Expand Up @@ -362,7 +366,8 @@ void setup(void) {
pinMode(photo0Pin, INPUT);
}
// the photo cell sensor has major noise. We will use a variation of a moving window average.
// the photo cell sensor has major noise.
// We will use a variation of a moving window average.
int photoAvg = 100;
const int photoAvgSamples = 5;
Expand All @@ -372,11 +377,13 @@ void loop(void) {
// read the photo cell value (ADC read value has a range of 0-1024)
int photo0value = analogRead(photo0Pin);
// normalize the raw sensor value. 0 is a covered sensor. 100 and above is a uncovered sensor.
// normalize the raw sensor value. 0 is a covered sensor.
// 100 and above is a uncovered sensor.
photo0value = map(max(photo0value, photoMin), photoMin, photoMax, 0, 100);
// calculate our moving avarage variant
photoAvg = (photoAvg * (photoAvgSamples-1) + photo0value) / photoAvgSamples;
photoAvg = (photoAvg * (photoAvgSamples-1) + photo0value);
photoAvg = photoAvg / photoAvgSamples;
// output debuging information
Serial.println(photoAvg);
Expand All @@ -395,10 +402,12 @@ void loop(void) {
// Generates a tone (square wave) on the provided speakerPin.
// The tone will last for timeInMilliseconds and have the frequencyInHertz.
//The method will block for the output time
void beep (unsigned char speakerPin, int frequencyInHertz, long timeInMilliseconds) {
void beep (unsigned char speakerPin, int frequencyInHertz,
long timeInMilliseconds) {
int x;
long halfCycleDelay = (long) (1000000 / frequencyInHertz / 2);
long cycleRepeats = (long) ((timeInMilliseconds * 1000) / (halfCycleDelay * 2));
long cycleRepeats = (long) (timeInMilliseconds * 1000);
cycleRepeats = cycleRepeats / (halfCycleDelay * 2);
for (x = 0; x < cycleRepeats; x++) {
digitalWrite(speakerPin, HIGH);
delayMicroseconds(halfCycleDelay);
Expand Down
10 changes: 5 additions & 5 deletions content/workshops/j_hens.md
Expand Up @@ -67,7 +67,7 @@ Now plug in your power supply with the micro-USB connection (like most recent mo

### Take control and see what’s going on!

For this we’re going to use a system called VNC (Virtual Network Computing) which is similar to (though somewhat less secure than) tools like Remote Desktop/Teamviewer/LogMeIn etc. It is simply a way of remotely accessing your Graphical User Interface (Desktop Environment). When you’re more at ease you can always use command line to make the Pi do your every bidding.
For this we’re going to use a system called VNC (Virtual Network Computing) which is similar to (though somewhat less secure than) tools like Remote Desktop / Teamviewer / LogMeIn etc. It is simply a way of remotely accessing your Graphical User Interface (Desktop Environment). When you’re more at ease you can always use command line to make the Pi do your every bidding.

Many VNC applications are available. With Windows we’ll use TightVNC Viewer. With Mac, Real VNC Viewer can be used. For Linux we can use Remmina (with Ubuntu) for example.

Expand Down Expand Up @@ -267,11 +267,10 @@ Useful online tutorial resources used in the making of this workshop:

Surveillance Camera Tutorials:

- <http://www.instructables.com/id/Raspberry-Pi-as-low-cost-HD-surveillance-camera/>
- Triggering events from Motion using Python: <https://medium.com/p/2d5a2d61da3d>
- Triggering events from Motion using Python:
- <https://medium.com/p/2d5a2d61da3d>
- RPi Twitter Bot: <http://www.makeuseof.com/tag/how-to-build-a-raspberry-pi-twitter-bot/>
- Tweeting using Python (Twython application): <https://twython.readthedocs.org/en/latest/>
- Quick guide to Nano Text Editor on RPI - Raspberry Pi Spy: <http://www.raspberrypi-spy.co.uk/2013/11/quick-guide-to-nano-text-editor-on-the-raspberry-pi/>

Going Further:

Expand All @@ -292,7 +291,8 @@ Contents of project and useful files:
- SD Formater 4.0 - <https://www.sdcard.org/downloads/formatter_4/>
- Win32 Disk Imager - <http://sourceforge.net/projects/win32diskimager/>
- Lastest Raspbian OS Image - <http://www.raspberrypi.org/downloads>
- Raspberry Pi® Quick Start Guide - <http://www.raspberrypi.org/wp-content/uploads/2012/04/quick-start-guide-v2_1.pdf>
- Raspberry Pi® Quick Start Guide -
- <http://www.raspberrypi.org/wp-content/uploads/2012/04/quick-start-guide-v2_1.pdf>
- Putty - Tools for SSH - <http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html>
- Filezilla - FTP Client - <https://filezilla-project.org/download.php?type=client>
- VLC Videolan - Media player - <http://www.videolan.org/vlc/>
Expand Down
2 changes: 1 addition & 1 deletion content/workshops/n_lights.md
Expand Up @@ -30,7 +30,7 @@ Make sure you have brought your RaspberryPi and a power connector for it. You wi

For installing Node.js, please go to <http://nodejs.org/>, click *Install* and follow the instructions.

*Optionally:* To make Node.js available outside the main installation folder (e.g., `/home/node`) you can make symbolic links to node and npm as follows:
*Optionally:* To make Node.js available outside the main installation folder (e.g., ` /home /node` ) you can make symbolic links to node and npm as follows:

$ sudo ln -s -f /home/node/bin/node /usr/bin/node
$ sudo ln -s -f /home/node/bin/npm /usr/bin/npm
Expand Down
4 changes: 4 additions & 0 deletions content/workshops/p_javarobots.md
Expand Up @@ -3,6 +3,10 @@
\thispagestyle{empty}
\mbox{}

\newpage
\thispagestyle{empty}
\mbox{}

\newpage

![](content/workshop_images/javarobots.jpg)
Expand Down
Binary file modified content/workshops/soldering/4.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/workshops/soldering/6.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/workshops/soldering/7.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/workshops/soldering/8.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion templates/print.tex
Expand Up @@ -50,7 +50,7 @@
\setdefaultlanguage{english}

% Page
\usepackage[paperwidth=6in, paperheight=9in, top=0.5in, bottom=0.5in, left=1in, right=0.5in]{geometry}
\usepackage[paperwidth=6in, paperheight=9in, top=0.5in, bottom=0.75in, left=1in, right=0.5in]{geometry}

% Footer & Header
\usepackage{fancyhdr}
Expand Down

0 comments on commit 478819b

Please sign in to comment.