BADCL Design Project 3 eleni
Monday, 27 February 2012
Saturday, 25 February 2012
When it was all going so well and then ...
so as I went to go and film my video, I saw that all my arduino had been pulled apart, lucky that john was still at uni so he helped me get it working again but I could only get one lamp to work, so my video is not very good, but im gonna see what i can do in the editting which wont be very much :/
Friday, 24 February 2012
Coding for the second pressure pad
Its the same code which is used apart slight changes to the imput and output, i think this is right ?
// constants won't change. They're used here to
// set pin numbers:
const int buttonPin = 3; // the number of the pushbutton pin
const int ledPin = 12; // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
pinMode(3, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(12, INPUT);
}
void loop(){
// 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);
}
}
// constants won't change. They're used here to
// set pin numbers:
const int buttonPin = 3; // the number of the pushbutton pin
const int ledPin = 12; // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
pinMode(3, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(12, INPUT);
}
void loop(){
// 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);
}
}
Thursday, 9 February 2012
Coding for my Pressure Pad
// 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
// variables will change:
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);
}
void loop(){
// 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);
}
}
Tuesday, 7 February 2012
Showing it works :)
Wiring up !
So here is where I wired up my arduino according to the one in my last picture, I followed and placed all the wires in the same place, and I added in my own pressure pad
I then wired it to an electrical box so I could use a proper light bulb instead of just a LED light.
After doing all the wiring and the coding, I tried it out to see if the light bulb would light up if I pressed down on the pressure pad.. . It worked !!
After making sure it all worked,I cut the wires down so it looked alot neater and you could see where the wired were actually placed.
Subscribe to:
Posts (Atom)