I think the new idea is perfect for University students, people who have just left home or people who are really close too their family. International students who are homesick can use this concept for when they miss home - using the switch to change the picture to another; whether its of their family or locations of their favourite places they'll be able to feel like they've never left.
It is just perfect for any student really, which is why we have changed the concept, mostly because students aren't time concious and care more for their family, friends and their home.
Wednesday, 25 April 2012
Tuesday, 24 April 2012
CHANGE OF IDEA
We as a group have decided to change the concept. We thought that maybe a clock would be a tad tedious for students and they wouldn't use it.
So with the help of Richard we came up with the idea that on the screen of your laptop, iPad, Playbook, what have you, you have an image of your friends, family, pets you name it, but when you press the switch, the image changes to another.
This concept is much better for our generation because we like things that are fun and simple...not too complicated and things to be done for us, so this is perfect for teenagers who want the easier things in life.
We as a group have decided to change the concept. We thought that maybe a clock would be a tad tedious for students and they wouldn't use it.
So with the help of Richard we came up with the idea that on the screen of your laptop, iPad, Playbook, what have you, you have an image of your friends, family, pets you name it, but when you press the switch, the image changes to another.
This concept is much better for our generation because we like things that are fun and simple...not too complicated and things to be done for us, so this is perfect for teenagers who want the easier things in life.
Tuesday, 10 April 2012
MY GROUP'S IDEA.
Basically we had to create a group of either 2's, 3's or 4's and decided that myself, Kirsty and Nadeem should work together on the interesting project.
After a lot of collaboration between Kirsty and I we decided to come up with the idea of a clock that when you push a button the screen will shake and give you the correct time. So as you can see its no ordinary clock, even though this has already been done, Kirsty and I have put a twist on ours. Ours is on either an iPad, tablet or playbook, this is because the Arduino board needs to be connected to a computer with this project and people wouldn't really have their laptop/computer on their beside table or bed - but you will find an iPad.
We came up with this idea after seeing a cube like object that lit up when the time changed - here is the object of our inspiration:
As you can see the words light up for when the time changes...which I think is totally awesome as its not like your usual clock that just ticks around in a circle or numbers changing.

Ours will mimic this but what will happen is; when you push the switch the contents (like on the screen above) will shake and you'll be left with the time...or the words will light up to what ever the time is...the whole shaking the screen might be a bit difficult to the amateurs of Arduino and Processing.
Basically we had to create a group of either 2's, 3's or 4's and decided that myself, Kirsty and Nadeem should work together on the interesting project.
After a lot of collaboration between Kirsty and I we decided to come up with the idea of a clock that when you push a button the screen will shake and give you the correct time. So as you can see its no ordinary clock, even though this has already been done, Kirsty and I have put a twist on ours. Ours is on either an iPad, tablet or playbook, this is because the Arduino board needs to be connected to a computer with this project and people wouldn't really have their laptop/computer on their beside table or bed - but you will find an iPad.
We came up with this idea after seeing a cube like object that lit up when the time changed - here is the object of our inspiration:
As you can see the words light up for when the time changes...which I think is totally awesome as its not like your usual clock that just ticks around in a circle or numbers changing.
Ours will mimic this but what will happen is; when you push the switch the contents (like on the screen above) will shake and you'll be left with the time...or the words will light up to what ever the time is...the whole shaking the screen might be a bit difficult to the amateurs of Arduino and Processing.
PROCESSING
Processing is an open source programme which is used for people who ultimately want to create either images, animations or interactions. Everyone from students to professionals use this in everyday life...which I am now.
Here are some codes that you would need to put in the sketchbook - to do this you go onto file --> examples --> sketchbook.
/*
* pa_8Switches
*
* Reads the values which represent the state of eight switches
* from the serial port and draws a graphical representation.
*
* This file is part of the Arduino meets Processing Project.
* For more information visit http://www.arduino.cc.
*
* copyleft 2005 by Melvin Ochsmann for Malm? University
*
*/
PImage number2;
PImage number3;
PImage number1;
PImage buffer;
// importing the processing serial class
import processing.serial.*;
// the display item draws background and grid
DisplayItems di;
// definition of window size and framerate
int xWidth = 512;
int yHeight = 512;
int fr = 12;
// attributes of the display
boolean bck = true;
boolean grid = true;
boolean g_vert = false;
boolean g_horiz = true;
boolean g_values = true;
boolean output = true;
// variables for serial connection, portname and baudrate have to be set
Serial port;
String portname = Serial.list()[0];
int baudrate = 9600;
int value = 0;
// variables to draw graphics
int i;
String fontname2 = "Helvetica-Bold-96.vlw"; // if you would like to change fonts, make sure the fontfile (which can be created with Processing) is in the data directory
int fontsize2 = 72; //
PFont font2;
float valBuf[] = new float[8];
int xpos, ypos;
// lets user control DisplayItems properties and value output in console
void keyPressed(){
if (key == 'b' || key == 'B') bck=!bck; // background black/white
if (key == 'g' || key == 'G') grid=!grid; // grid ON/OFF
if (key == 'v' || key == 'V') g_values=!g_values; // grid values ON/IFF
if (key == 'o' || key == 'O') output=!output; //turns value output ON/OFF
}
void setup(){
// set size and framerate
size(xWidth, yHeight); frameRate(fr);
// establish serial port connection
port = new Serial(this, portname, baudrate);
println(port);
number2 = loadImage("two.jpg");
number3 = loadImage("three.jpg");
number1 = loadImage("one.jpg");
buffer = number1;
// create DisplayItems object
di = new DisplayItems();
// load second font for graphical representation and clear value buffer
font2 = loadFont(fontname2);
for(i = 0; i < valBuf.length; i++ ){
valBuf[i] = (height/2);
}
}
void drawEightSwitchesState(){
textFont(font2, fontsize2);
if (output) print("8Switches State: ");
// takes value, interprets it as a byte
// and reads each bit
for (i=0; i < 8 ; i++){
if(output) print(value & 1);
// if a bit is 1 increase the corresponding value in value buffer array by 1
if ( (value & 1) == 1){
if(valBuf[i] > fontsize2 ) valBuf[i] -=1;
// if a bit is 0 decreade corresponding value
}else{
if(valBuf[i] < height) valBuf[i] += 1;
}
if(output) print(".");
// draw number for each value at its current height
fill( ( (i%3==0) ? 255 : 0 ), ((i%3==1) ? 255 : 0 ) ,((i%3==2) ? 255 : 0 ) );
text( ( ""+(i+1) ), (i*(width/9)) + (width/12), valBuf[i]);
value = value >> 1;
}// end for loop
if(output) println("");
}
void draw(){
// listen to serial port and set value
while(port.available() > 0){
value = port.read();
println(value);
}
// draw background, then EightSwitchesState and finally rest of DisplayItems
di.drawBack();
//drawEightSwitchesState();
di.drawItems();
if (value == 50){
buffer=number2;
}
else
if (value == 48){
buffer =number3;
}
else
buffer = number1;
image(buffer,50,50);
}
Processing is an open source programme which is used for people who ultimately want to create either images, animations or interactions. Everyone from students to professionals use this in everyday life...which I am now.
Here are some codes that you would need to put in the sketchbook - to do this you go onto file --> examples --> sketchbook.
/*
* pa_8Switches
*
* Reads the values which represent the state of eight switches
* from the serial port and draws a graphical representation.
*
* This file is part of the Arduino meets Processing Project.
* For more information visit http://www.arduino.cc.
*
* copyleft 2005 by Melvin Ochsmann for Malm? University
*
*/
PImage number2;
PImage number3;
PImage number1;
PImage buffer;
// importing the processing serial class
import processing.serial.*;
// the display item draws background and grid
DisplayItems di;
// definition of window size and framerate
int xWidth = 512;
int yHeight = 512;
int fr = 12;
// attributes of the display
boolean bck = true;
boolean grid = true;
boolean g_vert = false;
boolean g_horiz = true;
boolean g_values = true;
boolean output = true;
// variables for serial connection, portname and baudrate have to be set
Serial port;
String portname = Serial.list()[0];
int baudrate = 9600;
int value = 0;
// variables to draw graphics
int i;
String fontname2 = "Helvetica-Bold-96.vlw"; // if you would like to change fonts, make sure the fontfile (which can be created with Processing) is in the data directory
int fontsize2 = 72; //
PFont font2;
float valBuf[] = new float[8];
int xpos, ypos;
// lets user control DisplayItems properties and value output in console
void keyPressed(){
if (key == 'b' || key == 'B') bck=!bck; // background black/white
if (key == 'g' || key == 'G') grid=!grid; // grid ON/OFF
if (key == 'v' || key == 'V') g_values=!g_values; // grid values ON/IFF
if (key == 'o' || key == 'O') output=!output; //turns value output ON/OFF
}
void setup(){
// set size and framerate
size(xWidth, yHeight); frameRate(fr);
// establish serial port connection
port = new Serial(this, portname, baudrate);
println(port);
number2 = loadImage("two.jpg");
number3 = loadImage("three.jpg");
number1 = loadImage("one.jpg");
buffer = number1;
// create DisplayItems object
di = new DisplayItems();
// load second font for graphical representation and clear value buffer
font2 = loadFont(fontname2);
for(i = 0; i < valBuf.length; i++ ){
valBuf[i] = (height/2);
}
}
void drawEightSwitchesState(){
textFont(font2, fontsize2);
if (output) print("8Switches State: ");
// takes value, interprets it as a byte
// and reads each bit
for (i=0; i < 8 ; i++){
if(output) print(value & 1);
// if a bit is 1 increase the corresponding value in value buffer array by 1
if ( (value & 1) == 1){
if(valBuf[i] > fontsize2 ) valBuf[i] -=1;
// if a bit is 0 decreade corresponding value
}else{
if(valBuf[i] < height) valBuf[i] += 1;
}
if(output) print(".");
// draw number for each value at its current height
fill( ( (i%3==0) ? 255 : 0 ), ((i%3==1) ? 255 : 0 ) ,((i%3==2) ? 255 : 0 ) );
text( ( ""+(i+1) ), (i*(width/9)) + (width/12), valBuf[i]);
value = value >> 1;
}// end for loop
if(output) println("");
}
void draw(){
// listen to serial port and set value
while(port.available() > 0){
value = port.read();
println(value);
}
// draw background, then EightSwitchesState and finally rest of DisplayItems
di.drawBack();
//drawEightSwitchesState();
di.drawItems();
if (value == 50){
buffer=number2;
}
else
if (value == 48){
buffer =number3;
}
else
buffer = number1;
image(buffer,50,50);
}
PImage teddy;
float xpos;
float ypos;
float drag = 30;
void setup() {
size(200, 200);
teddy = loadImage("teddy.gif");
xpos = width/2;
ypos = height/2;
}
void draw() {
background(102);
float difx = mouseX - xpos-teddy.width/2;
if (abs(difx) > 1) {
xpos = xpos + difx/drag;
xpos = constrain(xpos, 0, width-teddy.width);
}
float dify = mouseY - ypos-teddy.height/2;
if (abs(dify) > 1) {
ypos = ypos + dify/drag;
ypos = constrain(ypos, 0, height-teddy.height);
}
// Display the sprite at the position xpos, ypos
image(teddy, xpos, ypos);
}
CODING
Everything you make with Arduino has a code. The code is there so the computer understands what you want to do and with this code you always get two values - HIGH and LOW. High starts at 1 and will obviously increase where needed (like a range for a motion sensor - every time your hand moves towards the sensor the higher the value) and obviously low will always be 0 or something lower than high (also like the range for a motion sensor - every time you move your hand away from the motion sensor the value goes down - because the sensor can't sense anything is there)
Here are some Arduino codes that we have used on Wednesdays lessons:
-This is for the switch:
/* switch
pinMode(controlLED, OUTPUT);
Everything you make with Arduino has a code. The code is there so the computer understands what you want to do and with this code you always get two values - HIGH and LOW. High starts at 1 and will obviously increase where needed (like a range for a motion sensor - every time your hand moves towards the sensor the higher the value) and obviously low will always be 0 or something lower than high (also like the range for a motion sensor - every time you move your hand away from the motion sensor the value goes down - because the sensor can't sense anything is there)
Here are some Arduino codes that we have used on Wednesdays lessons:
-This is for the switch:
/* switch
*
* Each time the input pin goes from LOW to HIGH (e.g. because of a push-button
* press), the output pin is toggled from LOW to HIGH or HIGH to LOW. There's
* a minimum delay between toggles to debounce the circuit (i.e. to ignore
* noise).
*
* David A. Mellis
* 21 November 2006
*/
* Each time the input pin goes from LOW to HIGH (e.g. because of a push-button
* press), the output pin is toggled from LOW to HIGH or HIGH to LOW. There's
* a minimum delay between toggles to debounce the circuit (i.e. to ignore
* noise).
*
* David A. Mellis
* 21 November 2006
*/
int inPin = 2; // the number of the input pin
int outPin = 13; // the number of the output pin
int outPin = 13; // the number of the output pin
int state = HIGH; // the current state of the output pin
int reading; // the current reading from the input pin
int previous = LOW; // the previous reading from the input pin
int reading; // the current reading from the input pin
int previous = LOW; // the previous reading from the input pin
// the follow variables are long's because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long time = 0; // the last time the output pin was toggled
long debounce = 200; // the debounce time, increase if the output flickers
// will quickly become a bigger number than can be stored in an int.
long time = 0; // the last time the output pin was toggled
long debounce = 200; // the debounce time, increase if the output flickers
void setup()
{
pinMode(inPin, INPUT);
pinMode(outPin, OUTPUT);
}
{
pinMode(inPin, INPUT);
pinMode(outPin, OUTPUT);
}
void loop()
{
reading = digitalRead(inPin);
{
reading = digitalRead(inPin);
// if the input just went from LOW and HIGH and we've waited long enough
// to ignore any noise on the circuit, toggle the output pin and remember
// the time
if (reading == HIGH && previous == LOW && millis() - time > debounce) {
if (state == HIGH)
state = LOW;
else
state = HIGH;
// to ignore any noise on the circuit, toggle the output pin and remember
// the time
if (reading == HIGH && previous == LOW && millis() - time > debounce) {
if (state == HIGH)
state = LOW;
else
state = HIGH;
time = millis();
}
}
digitalWrite(outPin, state);
previous = reading;
}
}
// constants won't change. They're used here to
// set pin numbers:
const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
void loop(){
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
}
else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}
/*// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
}
else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}
* ap_ReadMultiDigital_8
*
* Reads an 8 digital inputs and sends their values over the serial port.
* A byte variable is used to store the state of all eight pins. This byte
* is then sent over the serial port.
*
* This file is part of the Arduino meets Processing Project.
* For more information visit http://www.arduino.cc.
*
* copyleft 2005 by Melvin Ochsmann for Malm? University
*
*/
*
* Reads an 8 digital inputs and sends their values over the serial port.
* A byte variable is used to store the state of all eight pins. This byte
* is then sent over the serial port.
*
* This file is part of the Arduino meets Processing Project.
* For more information visit http://www.arduino.cc.
*
* copyleft 2005 by Melvin Ochsmann for Malm? University
*
*/
// 8 variables for each pin
int digitalInput_1 = 7;
int digitalInput_2 = 8;
int digitalInput_1 = 7;
int digitalInput_2 = 8;
// 8 variables to store the values
int value_1 = 0;
int value_2 = 0;
int value_1 = 0;
int value_2 = 0;
// byte variable to send state of all pins over serial port
int myByte = 0;
// control LED
int controlLED = 13;
void setup(){
int myByte = 0;
// control LED
int controlLED = 13;
void setup(){
// set pin modes
pinMode(digitalInput_1, INPUT);
pinMode(digitalInput_2, INPUT);
pinMode(digitalInput_1, INPUT);
pinMode(digitalInput_2, INPUT);
pinMode(controlLED, OUTPUT);
// begin sending out over the serial port
Serial.begin(9600);
}
Serial.begin(9600);
}
void loop(){
// set 'myByte' to zero
myByte = 0;
myByte = 0;
// then read all the INPUTS and store values in the corresponding variables
value_1 = digitalRead(digitalInput_1);
value_2 = digitalRead(digitalInput_2);
value_1 = digitalRead(digitalInput_1);
value_2 = digitalRead(digitalInput_2);
/* check values are high or low and 'add' each value to myByte
* ( what it actually does is this:
*
* 00 00 00 00 ('myByte set to zero')
* | 00 10 10 00 ('3 and 5 are 1')
* --------------
* 00 10 10 00 ('myByte after logical operation')
*
*/
* ( what it actually does is this:
*
* 00 00 00 00 ('myByte set to zero')
* | 00 10 10 00 ('3 and 5 are 1')
* --------------
* 00 10 10 00 ('myByte after logical operation')
*
*/
if (value_1) {
myByte = myByte | 1;
digitalWrite(controlLED, HIGH);
}
else
digitalWrite(controlLED, LOW);
myByte = myByte | 1;
digitalWrite(controlLED, HIGH);
}
else
digitalWrite(controlLED, LOW);
if (value_2) {
myByte = myByte | 2;
}
// send myByte out over serial port and wait a bit to not overload the port
Serial.print(myByte);
delay(10);
}
myByte = myByte | 2;
}
// send myByte out over serial port and wait a bit to not overload the port
Serial.print(myByte);
delay(10);
}
As you can see they are quite confusing, but once you get the hang of it, its actually quite easy. You just have to work hard to understand the codes....this is just for Arduino....there is Processing too!
CIRCUIT BOARDS....
In recent lessons we have been learning about Circuit Boards and switches and how they are used in everyday life.
We're using Arduino boards...before i came into this unit I had no idea what an Arduino board was and in lessons I thought everyone was crazy...but it does exist, this is what it is; an open-source prototyping platform based on flexible easy to use hardware and software.
This is a diagram of it:

Here it is in real life:

It's a little hard hitting but with time and patience I will get there.
In recent lessons we have been learning about Circuit Boards and switches and how they are used in everyday life.
We're using Arduino boards...before i came into this unit I had no idea what an Arduino board was and in lessons I thought everyone was crazy...but it does exist, this is what it is; an open-source prototyping platform based on flexible easy to use hardware and software.
This is a diagram of it:
Here it is in real life:
It's a little hard hitting but with time and patience I will get there.
Subscribe to:
Posts (Atom)