Physical+Computing

Computers vs People

 * System to be controlled || Control: computer (C) or human (H) || Reasons ||
 * Traffic lights ||  ||   ||
 * Driving a train ||  ||   ||
 * Car washing ||  ||   ||
 * Drilling a tooth at the dentist ||  ||   ||
 * Checking something on the Moon ||  ||   ||
 * Doors in a busy supermarket ||  ||   ||
 * Keeping a check on the condition of patients in hospital ||  ||   ||
 * Filling bottles of lemonade in a factory ||  ||   ||
 * CCTV cameras in a city centre ||  ||   ||
 * Painting cars on a production line ||  ||   ||




 * Task**

Useful Link for this task

Your task is to create a newsletter, You can use google docs for this. You need to include:
 * different sensors and their descriptions
 * write a few paragraphs on the benefits of computer control any why it may and may not be good for humans.
 * 

Arduino - Set Up
1. Firstly, you will need to install the Arduino software @http://www.arduino.cc/en/Main/Software

2. Install the driver so that your laptop will recognise the Arduino board.
 * Mac Download the driver Or Windows download this driver
 * Double click the ZIP file do unzip it
 * Open the folder ~/Downloads/CH341SER_MAC
 * Run installer found in that folder
 * If asked to restart, **do not restart just yet.**
 * This next step is only needed if you are on __**OS-X Yosemite.**__ For older versions of OS-X you do not need it:
 * Open Terminal Application (it's located in /Application/Utilities) and type this command once you see a prompt:
 * sudo nvram boot-args="kext-dev-mode=1"
 * See [|this post] if you wish to know why we need to run this command. I believe you need to do this because the driver is not signed properly, or is simply too old for Yosemite. Hopefully newer versions won't require this step and will automatically become enabled.
 * Now restart your Mac

Activity 1 - Blinking LED
You will need to wire your Arduino using the image below to guide you. Then copy and paste the code, and upload



For Code check Edmodo - activity 1
LEDs will only work in one direction. Try taking it out and twisting it 180 degrees. (no need to worry, installing it backwards does no permanent harm). || Program Not Uploading This happens sometimes, the most likely cause is a confused serial port, you can change this in tools>serial port> ||
 * Not Working? (2 things to try) || LED Not Lighting Up?

__SAVE__ YOUR PROJECT ONCE YOU HAVE COMPLETED IT BEFORE YOU MOVE ON TO THE EXTENSIONS BELOW

Extension 1 - ** Making it Better - EXPERIMENTING **

<span style="background-color: #ffffff; color: #444444; font-family: arial,sans-serif;">**Changing the pin:** <span style="background-color: #ffffff; color: #444444; font-family: arial,sans-serif;">The LED is connected to pin 1**2** but we can use any of the Arduino's pins. To change it take the wire plugged into pin 1**2**and move it to a pin of your choice (from 0-13) (you can also use analog 0-5 **)**

<span style="background-color: #ffffff; color: #444444; font-family: arial,sans-serif;">Then in the code change the line: int **ledPin** = 1**2**; **//Change to the//** //p**in number that you have chosen**;// // <span style="color: #444444; font-family: arial,sans-serif;">Then upload the sketch: (ctrl-u) //

// <span style="color: #444444; font-family: arial,sans-serif;">Change the Blink Time: // // <span style="color: #444444; font-family: arial,sans-serif;">Unhappy with one second on one second off? //

// <span style="color: #444444; font-family: arial,sans-serif;">In the code change the lines: //

// <span style="color: #0000ff; font-family: arial,sans-serif;">digitalWrite(ledPin, HIGH); // // <span style="color: #0000ff; font-family: arial,sans-serif;">delay(time on); // (seconds * 1000) digitalWrite(ledPin, LOW); delay(time off); //(seconds * 1000)

<span style="background-color: #ffffff; color: #444444; font-family: arial,sans-serif;">**Control the Brightness:** <span style="background-color: #ffffff; color: #444444; font-family: arial,sans-serif;">Along with digital (on/off) control the Arduino can control some pins in an analog (brightness) fashion. (more details on this in later circuits). To play around with it.

<span style="background-color: #ffffff; color: #0000ff; font-family: arial,sans-serif;">Change the LED to pin 9: (also change the wire) ledPin = 1**2**; -> int ledPin = 9; <span style="background-color: #ffffff; color: #0000ff; font-family: arial,sans-serif;">Replace the code inside the <span style="background-color: #ffffff; color: #444444; font-family: arial,sans-serif;">{ } <span style="background-color: #ffffff; color: #0000ff; font-family: arial,sans-serif;">'s of <span style="background-color: #ffffff; color: #444444; font-family: arial,sans-serif;">loop <span style="background-color: #ffffff; color: #0000ff; font-family: arial,sans-serif;"> with this: analogWrite(ledPin, new number); <span style="background-color: #ffffff; color: #444444; font-family: arial,sans-serif;">(new number) = any number between 0 and 255. 0 = <span style="background-color: #ffffff; color: #0000ff; font-family: arial,sans-serif;">off, 255 = on, in between = different brightness


 * For Extention Code - Check Edmodo Activity 2 **

= **Activity 3 - Simple On/Off Button** =




 * For Code - Check Edmodo Activity 3 Simple On/Off Button **


 * For extension - Check Edmodo Activity 4 Button as a Toggle Switch **


 * Activity 5 - 2 Buttons & LED **




 * For Code - Check Edmodo - Activity 5 2 Button LED **


 * Steeper Motor **