Showing posts with label Interactions. Show all posts
Showing posts with label Interactions. Show all posts

Friday, January 22, 2010

Simple Reed Switch Circuit



Ive taken the code from the adruino tutorials-
Button: use a pushbutton to control an LED.
I just replaced the Push Button switch with a Reed Switch i.e. a magnetic switch. The contacts close and complete the circuit when a magnet is brought near it.

Simple Reed Switch Adruino Code

// set pin numbers:

const int buttonPin = 3; // the number of the reedswitch 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 reedswitch pin as an input:
pinMode(buttonPin, INPUT);
}

void loop(){
// read the state of the reedswitch value:
buttonState = digitalRead(buttonPin);

// check if the reedswitch 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);
}
}

Monday, January 18, 2010

Initial Toy concept

The initial idea was to make a toy based on the food chain. Animals should respond to each other according to the rules of nature. They should exhibit instinctive behaviour of some kind.

Below are a few of my early explorations of theme. Just to test the possible interactions.