Tuesday, 24 February 2015

Tasks 5-8(Complete)

5. Find the forum associated with main Arduino site. Take a screen shot of something in the forum that interests you with a comment on what appeals to you.
-http://forum.arduino.cc/
-Best way for the physical connection of LEDs to cables (without soldering)?


6. Find a picture of your Arduino  publish it in your blog and label the main parts. You may need a special graphics program to do this. Add another interesting Arduino variation. You can see some on this page.
Chose this board due to the large number of pins. Would be useful for home automation(possibly) or large arrays of n x n x n LED arrays if not using some sort of serial communication to it.


7. Put the url for your blog into the wiki in Moodle. Add some other contact details. If you wish your cell phone number to remain private that's OK too.
-Done

8. Check out the following sites. Insert a screen shot and a URL link into your blog. Small images or large ones are both OK .

The Arduino environment version 1.5 or (stop press) 1.6.
 -

The Processing environment.
 -

https://processing.org/reference/environment 


The Fritzing files.
 -http://fritzing.org/


Link to Blogger.
 -


 blogger.com

GNU gcc
 -


 https://gcc.gnu.org/

Moodle

-http://moodle.op.ac.nz/
 
AVR Studio download. Latest version.
 -

 Version 6.2

PDF of ATMega 328
-http://www.atmel.com/Images/Atmel-8271-8-bit-AVR-Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-328P_datasheet_Summary.pdf




PDF of specs of USB-to-serial chip. The one used in the Duemilanove.
 -http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf

Really not sure if this is the correct one...

Good pic of our arduino clone
-

The MindKits site.
-http://www.mindkits.co.nz/


 
One cool video on Youtube.
-30 Arduino Projects for the Evil Genius



One other interesting internet resources. eg "Make" site or electonics sites.
-Instructables


 
The Nice Gear store in Timaru that sells good Arduinos.
-http://nicegear.co.nz
 

Tasks 17-20(Only 19 done)

17. Insert a variation so that the LEDs blink together.
18. Write a program so that one LED is blinking fast while the other blinks slowly.

19. Copy the ASCII printing program from http://arduino.cc/en/Tutorial/ASCIITableand run it. A good background site is the lady ada serial tutorial.

/*
  ASCII table
 
 Prints out byte values in all possible formats:  
 * as raw binary values
 * as ASCII-encoded decimal, hex, octal, and binary values
 
 For more on ASCII, see http://www.asciitable.com and http://en.wikipedia.org/wiki/ASCII
 
 The circuit:  No external hardware needed.
 
 created 2006
 by Nicholas Zambetti
 modified 9 Apr 2012
 by Tom Igoe
 
 This example code is in the public domain.

 <http://www.zambetti.com>
 
 */
void setup() {
 //Initialize serial and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }
 
  // prints title with ending line break
  Serial.println("ASCII Table ~ Character Map");
}

// first visible ASCIIcharacter '!' is number 33:
int thisByte = 33;
// you can also write ASCII characters in single quotes.
// for example. '!' is the same as 33, so you could also use this:
//int thisByte = '!';  

void loop() {
  // prints value unaltered, i.e. the raw binary version of the
  // byte. The serial monitor interprets all bytes as
  // ASCII, so 33, the first number,  will show up as '!'
  Serial.write(thisByte);    

  Serial.print(", dec: ");
  // prints value as string as an ASCII-encoded decimal (base 10).
  // Decimal is the  default format for Serial.print() and Serial.println(),
  // so no modifier is needed:
  Serial.print(thisByte);      
  // But you can declare the modifier for decimal if you want to.
  //this also works if you uncomment it:

  // Serial.print(thisByte, DEC);  


  Serial.print(", hex: ");
  // prints value as string in hexadecimal (base 16):
  Serial.print(thisByte, HEX);    

  Serial.print(", oct: ");
  // prints value as string in octal (base 8);
  Serial.print(thisByte, OCT);    

  Serial.print(", bin: ");
  // prints value as string in binary (base 2)
  // also prints ending line break:
  Serial.println(thisByte, BIN);  

  // if printed last visible character '~' or 126, stop:
  if(thisByte == 126) {     // you could also use if (thisByte == '~') {
    // This loop loops forever and does nothing
    while(true) {
      continue;
    }
  }
  // go on to the next character
  thisByte++;  
}


20. Same as 19 but make some changes in formatting. Indicate your changes through a comment.
 
20.1 Have a look at this blog and run the following programs as they are set out in the blog then make some interesting changes that you indicate with a comment and publish your versions in your blog.
20.11 Echo, echo.
20.12 Stage 2, delimiter
20.13 Stage 3, Arduino maths.
20.14 Stage 4, simple transmission of a double.
20.15 Stage 4 again, Double, double.
20.16 Stage 5, analog read. (Very similar to 18.1 above.)

Tasks 13-16(Complete except 16)

13. Write a program that will have the LED mostly off. That is it only blips on once a second if you look closely.
/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.

  Most Arduinos have an on-board LED you can control. On the Uno and
  Leonardo, it is attached to digital pin 13. If you're unsure what
  pin the on-board LED is connected to on your Arduino model, check
  the documentation at http://arduino.cc

  This example code is in the public domain.

  modified 8 May 2014
  by Scott Fitzgerald
  Edited by Arron Dick
 */


// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);              // wait for bit
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(900);              // wait for rest of a second
}

14. Same as 13 but this time have your LED mostly on.
/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.

  Most Arduinos have an on-board LED you can control. On the Uno and
  Leonardo, it is attached to digital pin 13. If you're unsure what
  pin the on-board LED is connected to on your Arduino model, check
  the documentation at http://arduino.cc

  This example code is in the public domain.

  modified 8 May 2014
  by Scott Fitzgerald
  Edited by Arron Dick
 */


// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(900);              // wait for bit
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(100);              // wait for rest of a second
}

15. Repeat 14 with an external LED on a breadboard.
Done, same code
16. Copy the two LED program into your blog and run it.
 WHERE is it?

Tasks 9-12(Complete except 9)

9. Find 4 more Arduino LED related videos in Youtube, BlipTV etc. Put a link and a two-sentence review about each one in your blog. Be prepared to talk about one or more of them to the class.
a)https://youtu.be/7vhvnaWUZjE
This video describes some similarities and differences to help choose whether to use Arduino or RaspberryPI in an electronics project. The RasberryPI is more powerful, but requires more power to run and is not as good at driving hardware directy.

b)

c)

d)

10. Establish a sketchpad folder in the D Drive or in a USB pen or somewhere you can get to.
-Done (sketchbook) in folder on onedrive
The next tasks will relate to programming your Arduino using the Blink program with variations. So you might like to get going on setting things up.

All programs from now on need their source code to be entered into your blog with comments. Make sure you comment the the top of your blog posting with the number of the task and enter too the task number as a //comment in your code.

11. Copy the famous Blink program to your blog and make sure you can run it on you Arduino.
-Done
12. Create a variation in timing and put your new program into your blog. Indicate with a comment what your change was.
/*
SparkFun Inventor's Kit
Example sketch 01

BLINKING A LED

  Turn an LED on for one second, off for one second,
  and repeat forever.

Hardware connections:

  Most Arduinos already have an LED and resistor connected to
  pin 13, so you may not need any additional circuitry.

  But if you'd like to connect a second LED to pin 13, or use
  a different pin, follow these steps:

    Connect the positive side of your LED (longer leg) to Arduino
    digital pin 13 (or another digital pin, don't forget to change
    the code to match).
  
    Connect the negative side of your LED (shorter leg) to a 
    330 Ohm resistor (orange-orange-brown). Connect the other side
    of the resistor to ground.

    pin 13 _____ + LED - _____ 330 Ohm _____ GND
 
    (We always use resistors between the Arduino and and LEDs
    to keep the LEDs from burning out due to too much current.)

This sketch was written by SparkFun Electronics,
with lots of help from the Arduino community.
This code is completely free for any use.
Visit http://learn.sparkfun.com/products/2 for SIK information.
Visit http://www.arduino.cc to learn about the Arduino.

Version 2.0 6/2012 MDG
*/


// Welcome to Arduino!

// If you're brand-new to this, there will be some new things to
// learn, but we'll jump right in and explain things as we go.

// The Arduino is a tiny computer that runs programs called
// "sketches". These are text files written using instructions
// the computer understances. You're reading a sketch right now.

// Sketches have computer code in them, but also (hopefully)
// "comments" that explain what the code does. Comments and code
// will have different colors in the editor so you can tell them
// apart.

// This is a comment - anything on a line after "//" is ignored
// by the computer.

/* This is also a comment - this one can be multi-line, but it
must start and end with these characters */

// A "function" is a named block of code, that performs a specific,
// well, function. Many useful functions are already built-in to
// the Arduino; others you'll name and write yourself for your
// own purposes.

// All Arduino sketches MUST have two specific functions, named
// "setup()" and "loop()". The Arduino runs these functions
// automatically when it starts up or if you press the reset
// button. You'll typically fill these function "shells" with your
// own code. Let's get started!


// The setup() function runs once when the sketch starts.
// You'll use it for things you need to do first, or only once:


void setup()
{
  // The Arduino has 13 digital input/output pins. These pins
  // can be configured as either inputs or outputs. We set this
  // up with a built-in function called pinMode().

  // The pinMode() function takes two values, which you type in
  // the parenthesis after the function name. The first value is
  // a pin number, the second value is the word INPUT or OUTPUT.
  
  // Here we'll set up pin 13 (the one connected to a LED) to be
  // an output. We're doing this because we need to send voltage
  // "out" of the Arduino to the LED.

  pinMode(13, OUTPUT);

  // By the way, the Arduino offers many useful built-in functions
  // like this one. You can find information on all of them at the
  // Arduino website: http://arduino.cc/en/Reference
}


// After setup() finishes, the loop() function runs over and over
// again, forever (or until you turn off or reset the Arduino).
// This is usually where the bulk of your program lives:


void loop()
{
  // The 13 digital pins on your Arduino are great at inputting
  // and outputting on/off, or "digital" signals. These signals
  // will always be either 5 Volts (which we call "HIGH"), or
  // 0 Volts (which we call "LOW").

  // Because we have an LED connected to pin 13, if we make that
  // output HIGH, the LED will get voltage and light up. If we make
  // that output LOW, the LED will have no voltage and turn off.

  // digitalWrite() is the built-in function we use to make an
  // output pin HIGH or LOW. It takes two values; a pin number,
  // followed by the word HIGH or LOW:

  digitalWrite(13, HIGH);   // Turn on the LED

  // delay() is a function that pauses for a given amount of time.
  // It takes one value, the amount of time to wait, measured in
  // milliseconds. There are 1000 milliseconds in a second, so if
  // you delay(1000), it will pause for exactly one second:
  
  //AJD added double blink, should blink twice every second
  delay(100);
  digitalWrite(13,LOW);
  delay(100);
  digitalWrite(13,HIGH);
  delay(100);
  digitalWrite(13,LOW);
  delay(700);              // Wait for rest of the second
  

  // All together, the above code turns the LED on, waits one
  // second, turns it off, and waits another second.

  // When the computer gets to the end of the loop() function,
  // it starts loop() over again. So this program will continue
  // blinking the LED on and off!

  // Try changing the 1000 in the above delay() functions to
  // different numbers and see how it affects the timing. Smaller
  // values will make the loop run faster. (Why?)
}

Tuesday, 17 February 2015

Tasks 1-4(Complete)

1. Start your blog.
-Done

2. Edit the permissions in your blog so that just prjbrook@gmail.com is invited to see it.
-Invite sent

3. Make sure you can access the Arduino environment. Find the Blink program in the examples and paste into your blog. Test that it compiles in the Arduino IDE but you don't have to send it to your Arduino yet.
-Installed on laptop

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.

  Most Arduinos have an on-board LED you can control. On the Uno and
  Leonardo, it is attached to digital pin 13. If you're unsure what
  pin the on-board LED is connected to on your Arduino model, check
  the documentation at http://arduino.cc

  This example code is in the public domain.

  modified 8 May 2014
  by Scott Fitzgerald
 */


// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}

4. What is the name of the Atmel microprocessor in your Arduino board? Insert the link to the large pdf from Atmel associated with this chip. Insert an image of the first page of this pdf. Finally insert a picture of the pin-out of this chip.
- Arduino Uno R3 contained within the SparkFun kit now uses an ATmega328


Datasheet Specs