From the Deccan Chronicle article Puppetnama
Shreyas Raj, a student of puppetry says, “I went for a puppet show and that’s how I got interested in it. I’ve been learning rod and string puppetry for three years now.”
He adds, “I like puppetry because it’s a fascinating live medium for story-telling and it’s going to remain a passion for me.”
For design student Alannah D’Souza, puppetry is a brand new avenue. Alannah’s “Grub” is a set of four hungry monsters that exhibit instinctive behaviour when you play hunt and attack. Two are bigger glove puppets and two, smaller finger puppets which react when in contact with the bigger characters. Alannah explains, “One puppet vibrates and trembles in fear and the other lights up when it’s scared.” Though these are not part of a puppet theatre, they are built to be interactive.
However, the biggest innovation in puppetry would be that of the robotic arm created by Prof Dinesh NS, who teaches electronic design technology at IISc. Instead of manual manipulation of puppets, the puppets are controlled by a robotic arm programmed to imitate a puppeteer’s movements. Prof Dinesh is also one of the participants in the puppet festival to be held in May.
Saturday, May 1, 2010
Monday, April 19, 2010
Grub at the Toy exhibit
Wednesday, March 24, 2010
How to make Sew in Magnets
Found a nice link about how to stitch magnets to fabric from You sew, Girl. It can be done using fusing fabric. I wil try it soon and put up the results.
Thursday, March 18, 2010
Friday, March 5, 2010
Battery Pack
This a battery pack that has two 3V coin cells in it. The circuit gets enough power from this 6V supply. Anything over 5V will work. This is a much smaller and lighter than the bulky 9V battery i was using earlier. I made this battery pack by following the How to make a Battery Pack instructable online.
It works for a temporary fix but I think I'll solder wires on for the final use cause the wires keep shifting under the tape.
It works for a temporary fix but I think I'll solder wires on for the final use cause the wires keep shifting under the tape.
Tuesday, March 2, 2010
Random Behaviour
Im working on code that will make blobs behaviour unpredictable. So that every time it gets bitten it reacts differently. The code isn't finished yet but anyway.
ARDUINO CODE
// set pin numbers:
const int buttonPin = 7; // the number of the reedswitch pin
long randNumber;
//const int motorPin = 8; // the number oh the motor pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
int pin2 = 2;
int pin3 = 3;
int pin4 = 4;
int pin5 = 5;
int timer = 100;
void setup() {
// initialize the reedswitch pin as an input:
pinMode(buttonPin, INPUT);
// initialize the motor as as output
// pinMode(motorPin, OUTPUT);
// initialize the LED pin as an output:
pinMode(pin2, OUTPUT);
pinMode(pin3, OUTPUT);
pinMode(pin4, OUTPUT);
pinMode(pin5, OUTPUT);
randomSeed(analogRead(0));
Serial.begin(9600);
}
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:
randNumber = random(5);
delay(50);
Serial.println(randNumber); }
if ( randNumber==1){
digitalWrite(pin2,HIGH);
delay(1000);
digitalWrite(pin4,HIGH);
delay(1000);}
else if ( randNumber==4){
digitalWrite(pin2, HIGH);
delay(timer);
digitalWrite(pin2, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin2, HIGH);
delay(timer);
digitalWrite(pin2, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);}
else if ( randNumber==2){
// i=0;
// turn LED off:
digitalWrite(pin2, HIGH);
digitalWrite(pin4, HIGH);
digitalWrite(pin3, HIGH);
digitalWrite(pin5, HIGH);}
else {
// turn motor off:
//digitalWrite(motorPin, LOW);
// turn LED off:
digitalWrite(pin2, LOW);
digitalWrite(pin4, LOW);
digitalWrite(pin3, LOW);
digitalWrite(pin5, LOW);
}}
ARDUINO CODE
// set pin numbers:
const int buttonPin = 7; // the number of the reedswitch pin
long randNumber;
//const int motorPin = 8; // the number oh the motor pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
int pin2 = 2;
int pin3 = 3;
int pin4 = 4;
int pin5 = 5;
int timer = 100;
void setup() {
// initialize the reedswitch pin as an input:
pinMode(buttonPin, INPUT);
// initialize the motor as as output
// pinMode(motorPin, OUTPUT);
// initialize the LED pin as an output:
pinMode(pin2, OUTPUT);
pinMode(pin3, OUTPUT);
pinMode(pin4, OUTPUT);
pinMode(pin5, OUTPUT);
randomSeed(analogRead(0));
Serial.begin(9600);
}
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:
randNumber = random(5);
delay(50);
Serial.println(randNumber); }
if ( randNumber==1){
digitalWrite(pin2,HIGH);
delay(1000);
digitalWrite(pin4,HIGH);
delay(1000);}
else if ( randNumber==4){
digitalWrite(pin2, HIGH);
delay(timer);
digitalWrite(pin2, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin2, HIGH);
delay(timer);
digitalWrite(pin2, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);}
else if ( randNumber==2){
// i=0;
// turn LED off:
digitalWrite(pin2, HIGH);
digitalWrite(pin4, HIGH);
digitalWrite(pin3, HIGH);
digitalWrite(pin5, HIGH);}
else {
// turn motor off:
//digitalWrite(motorPin, LOW);
// turn LED off:
digitalWrite(pin2, LOW);
digitalWrite(pin4, LOW);
digitalWrite(pin3, LOW);
digitalWrite(pin5, LOW);
}}
Monday, March 1, 2010
Tinga Tinga Tales
Tinga Tinga Tales is a 52 episodes children's series based on African folk tales and aimed at 4- to 6-year olds. It was commissioned by the BBC for its CBeebies channel, and by Disney for its Playhouse channel. Named after the Tingatinga art from Tanzania, it will be made in Kenya by a studio of about 50 people.
The series was first developed by Claudia Lloyd, head of animation at Tiger Aspect, while travelling through Africa. The First three episodes premiered on the BBC website in early February 2010.Sunday, February 28, 2010
New behaviour for blob
Ive done this by using a counter (increment) in the code. So the programmed counts how long the switch is on and sends output accordingly.
ARDUINO CODE
// set pin numbers:
const int buttonPin = 7; // the number of the reedswitch pin
int buttonState = 0; // variable for reading the pushbutton status
int pin2 = 2;
int pin3 = 3;
int pin4 = 4;
int pin5 = 5;
int i = 0; // the counter
void setup() {
// initialize the reedswitch pin as an input:
pinMode(buttonPin, INPUT);
// initialize the LED pin as an output:
pinMode(pin2, OUTPUT);
pinMode(pin3, OUTPUT);
pinMode(pin4, OUTPUT);
pinMode(pin5, OUTPUT);
Serial.begin(9600);
}
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) {
i++; // increase the counter by 1
Serial.println(i);
if ( i < 4){ // if the couter is more than 4
digitalWrite(pin2,HIGH);
delay(1000);
digitalWrite(pin4,HIGH);
delay(1000);}
else if ( i < 9){ // if the couter is more than 9
digitalWrite(pin2, HIGH);
delay(timer);
digitalWrite(pin2, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin2, HIGH);
delay(timer);
digitalWrite(pin2, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);}
else if ( i > 10){ // if the couter is more than 10, blob is dead
digitalWrite(pin2, LOW);
digitalWrite(pin4, LOW);
digitalWrite(pin3, LOW);
digitalWrite(pin5, LOW);}
}
else {
i=0;
// turn LED off:
digitalWrite(pin2, LOW);
digitalWrite(pin4, LOW);
digitalWrite(pin3, LOW);
digitalWrite(pin5, LOW);
Serial.println(i);
}
}
Wednesday, February 24, 2010
User test
I showed the toy neighbour of mine. He is 5 years old. He didnt know what puppets were. So I explained the concept to him. It took him a while to get used to the gestures but once he got the hang of it he really got into it.
He'd narrate stories and then we'd act it out. He wanted as many people involved in the game as possible. The stories varied. Settings changed- water, forest, space. There were friends, enemies, strategies, magic, a doctor and an operation. Also and interesting backstory for fig- he said since fig is a plant he has to spend a 100 days in the mud and only then can he go play with his friends.
He found Blob a little difficultto handle so he didnt want to be blob. But since he like the character, he asked me to be blob to keep him in the game. At the end he figured out his own easy wasy of using Blob.
He enjoyed being the characters he found easy to use. He wasnt so interested in the electronics.
I also showed the toys 2 other kids who are brother (5 yrs) and sister (3 years). They weren't so verbal. The boy kept running of with fig cause they both loved that you had to blow out the tentacle. He ran away with it so he wouldnt have to share it with his sister. She tried out most of the puppets and was able to slowly pick up the gestures.
I have a hunch girls will be better at the gestures. I'll i know after some more tests, lets see how it turns out :)
He'd narrate stories and then we'd act it out. He wanted as many people involved in the game as possible. The stories varied. Settings changed- water, forest, space. There were friends, enemies, strategies, magic, a doctor and an operation. Also and interesting backstory for fig- he said since fig is a plant he has to spend a 100 days in the mud and only then can he go play with his friends.
He found Blob a little difficultto handle so he didnt want to be blob. But since he like the character, he asked me to be blob to keep him in the game. At the end he figured out his own easy wasy of using Blob.
He enjoyed being the characters he found easy to use. He wasnt so interested in the electronics.
I also showed the toys 2 other kids who are brother (5 yrs) and sister (3 years). They weren't so verbal. The boy kept running of with fig cause they both loved that you had to blow out the tentacle. He ran away with it so he wouldnt have to share it with his sister. She tried out most of the puppets and was able to slowly pick up the gestures.
I have a hunch girls will be better at the gestures. I'll i know after some more tests, lets see how it turns out :)
Sunday, February 21, 2010
Interaction Prototype
With the earlier prototype I had tested the basic concept of Grub i.e. a set of monsters that each other. I know need to test two aspects of the toy:
1) How well the characters work as hand puppets?
2) How kids react to behavior of the embedded electronics?
1) HAND PUPPETS
In order to test this I have created very rough fabric prototypes of each character. I also have done this to see what kids understand of the form of each character and how they use them.
Shrimp with a finger pocket under its belly.
Fig opening its dull covering to show off bright inner petals.
Saber with finger spaces for pincers and velcro lice on its feet.
Blob with finger pockets on either side and in its eye socket/ neck. And a velcro patch on its bottom for eating lice. yummy!
2)ELECTRONICS
I have created a sock character to see how kids will react to blob lighting up. And hope to hear through the test what kinds of behaviour they would like it exhibit (fear, death etc.)
Yayeee! It actually works!
1) How well the characters work as hand puppets?
2) How kids react to behavior of the embedded electronics?
1) HAND PUPPETS
In order to test this I have created very rough fabric prototypes of each character. I also have done this to see what kids understand of the form of each character and how they use them.
Shrimp with a finger pocket under its belly.
Fig opening its dull covering to show off bright inner petals.
Saber with finger spaces for pincers and velcro lice on its feet.
Blob with finger pockets on either side and in its eye socket/ neck. And a velcro patch on its bottom for eating lice. yummy!
2)ELECTRONICS
I have created a sock character to see how kids will react to blob lighting up. And hope to hear through the test what kinds of behaviour they would like it exhibit (fear, death etc.)
Yayeee! It actually works!
Labels:
Character,
Electronics,
Prototype,
Puppets
The Technicals
So I had a difficult 1 and half weeks working on the technology. Cause one silly little mistake and it just wont work. It drove me crazy but seems to be ready for a first test. Phew!
In order to the test the technology I decided to create my own arduino board(micro-controller). This turns out cheaper, smaller and sturdy enough to test.
So..
1) I made an arduino on a breadboard using the ITP Tutorial
(and ofcourse the first thing you do when its ready is get an LED to blink)
2) Attach the reed switch circuit to the breadboard Arduino
3) Solder everything onto a perf board.
Freeware like eagle lite is available to help you layout your circuit. But since I didn't feel like working with another software I drew it out with pencil and paper. And yes i guess this only makes sense for a relatively simple circuit.
In order to the test the technology I decided to create my own arduino board(micro-controller). This turns out cheaper, smaller and sturdy enough to test.
So..
1) I made an arduino on a breadboard using the ITP Tutorial
(and ofcourse the first thing you do when its ready is get an LED to blink)
2) Attach the reed switch circuit to the breadboard Arduino
3) Solder everything onto a perf board.
Freeware like eagle lite is available to help you layout your circuit. But since I didn't feel like working with another software I drew it out with pencil and paper. And yes i guess this only makes sense for a relatively simple circuit.
Saturday, January 30, 2010
Monster Hierarchy
Heres how the monsters relate to each other.
Saber and Fig are the top predators. They rule over the other two; Fig with its cunning and Saber with brute force.
When shrimp is under threat from the predators it shivers in fear and uses its speed to escape. Otherwise it lives its life in constant fear; motivated only by the ball of food it eats and shits out.
Blob starts lighting up as a threat display to the predators. It is too lazy to move itself. It eats the lice that feed on Saber.
Saber and Fig are the top predators. They rule over the other two; Fig with its cunning and Saber with brute force.
When shrimp is under threat from the predators it shivers in fear and uses its speed to escape. Otherwise it lives its life in constant fear; motivated only by the ball of food it eats and shits out.
Blob starts lighting up as a threat display to the predators. It is too lazy to move itself. It eats the lice that feed on Saber.
Character Development- Monster No.4
Saber (for now) is the scariest monster. The very sight of it and the other creatures make a hasty retreat. It is larger and towers over the other creatures. It doesn't really need to be a strategic hunter as the rest are no match for its strength.
There are lice that camouflage and live on its legs. It is unaware of these lice and can barely see them. Blob feeds on these Lice.
There are lice that camouflage and live on its legs. It is unaware of these lice and can barely see them. Blob feeds on these Lice.
Character Development- Monster No.3
Fig (for now) is a cunning predator. On the outside it is a dull mossy pod but it opens out its vibrant petals to attract pray. It lays there deceptively beautiful and calm until prey swims near enough. Then its strikes and traps the prey with its frog like tongue. Once the prey is caught the pod closes up.
Character Development- Monster No.2
Shrimp (for now) is a swift, energetic creature. Its always watching its back and slithers away hastily at the smallest hint of danger. It gets scared easily and shivers when it senses a predator.Its a simple creature that eats simple food and shits it out. Its speed is an asset that helps it outrun predators.
Character Development- monster no.1
This monster who for now is called Blob. Its a lazy bored lump. It believes its dull life has no purpose. It'll drag itself sideways an inch or 2 on the rare occasion it feels inspired to do so. Even when a predator comes along it makes an effort to escape but gives up soon enough. It sits put and starts glowing and lighting up in a lame threat to keep the predator away.
Friday, January 22, 2010
Combining Codes
Here I used the Reed switch to turn on and off a motor (cell phone vibrator) and a set of LEDs. The LEDs are being run on a variation the Knightrider Tutorial from the Arduino website.
// set pin numbers:
const int buttonPin = 7; // the number of the reedswitch pin
const int motorPin = 8; // the number oh the motor pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
int pin2 = 2;
int pin3 = 3;
int pin4 = 4;
int pin5 = 5;
int timer = 100;
int timer2 = 1000;
void setup() {
// initialize the reedswitch pin as an input:
pinMode(buttonPin, INPUT);
// initialize the motor as as output
pinMode(motorPin, OUTPUT);
// initialize the LED pin as an output:
pinMode(pin2, OUTPUT);
pinMode(pin3, OUTPUT);
pinMode(pin4, OUTPUT);
pinMode(pin5, OUTPUT);
Serial.begin(9600);
}
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 motor on
digitalWrite(motorPin, HIGH);
delay(timer2);
digitalWrite(motorPin, LOW);
delay(timer);
// turn LED on:
digitalWrite(pin2, HIGH);
delay(timer);
digitalWrite(pin2, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
Serial.println("ON");
digitalWrite(pin2, HIGH);
delay(timer);
digitalWrite(pin2, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);
}
else {
// turn motor off:
digitalWrite(motorPin, LOW);
// turn LED off:
digitalWrite(pin2, LOW);
digitalWrite(pin4, LOW);
digitalWrite(pin3, LOW);
digitalWrite(pin5, LOW);
Serial.println("OFF");
}
}
// set pin numbers:
const int buttonPin = 7; // the number of the reedswitch pin
const int motorPin = 8; // the number oh the motor pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
int pin2 = 2;
int pin3 = 3;
int pin4 = 4;
int pin5 = 5;
int timer = 100;
int timer2 = 1000;
void setup() {
// initialize the reedswitch pin as an input:
pinMode(buttonPin, INPUT);
// initialize the motor as as output
pinMode(motorPin, OUTPUT);
// initialize the LED pin as an output:
pinMode(pin2, OUTPUT);
pinMode(pin3, OUTPUT);
pinMode(pin4, OUTPUT);
pinMode(pin5, OUTPUT);
Serial.begin(9600);
}
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 motor on
digitalWrite(motorPin, HIGH);
delay(timer2);
digitalWrite(motorPin, LOW);
delay(timer);
// turn LED on:
digitalWrite(pin2, HIGH);
delay(timer);
digitalWrite(pin2, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
Serial.println("ON");
digitalWrite(pin2, HIGH);
delay(timer);
digitalWrite(pin2, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);
digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);
digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);
}
else {
// turn motor off:
digitalWrite(motorPin, LOW);
// turn LED off:
digitalWrite(pin2, LOW);
digitalWrite(pin4, LOW);
digitalWrite(pin3, LOW);
digitalWrite(pin5, LOW);
Serial.println("OFF");
}
}
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);
}
}
Tuesday, January 19, 2010
Monday, January 18, 2010
Initial Toy concept
The Inspiration
Subscribe to:
Posts (Atom)