The Axe Game
Team: Ashwini, Manisha, Shilpi, Sushmita, Swati

After the first 2 days we understood and learned usage of arduino, bred board and different sensors, we had to now do a small 1 day project using the concepts and sensors.

Objective:

Make a small Interactive game using sensors and arduino.

Project:

We build a new game ’Saver or Chopper’ which is very challenging, also involves a lot of risk. This game has got an Axe hanging on the top oscillating equally both the sides at angle of 120.
And there is cute toy kept inside the box, the player had to take the risk and get the toy from inside, but as the player tries to come to pick up the top, axe starts oscillating at a very high speed.

flickr:5607420350flickr:5607420364flickr:5607420368flickr:5607420370flickr:5607420372flickr:5607420378

Components used:

1. Arduino duemilanove
3. Sharp Proximity sensor
4. Servo Motor
5. Switches , wires and bred board

Final look of game:

flickr:5607429858

Play:

flickr:5606845261

The Program:

#include <Servo.h>

Servo myservo; 
float pos = 0;
int sensorValue;
int sensorPin = A0;
int val;
const int buttonPin = 2;
int buttonState = 0;

void setup() {
pinMode(sensorPin, INPUT);
pinMode(buttonPin, INPUT);
myservo.attach(9);

Serial.begin(9600);

sensorValue = analogRead(sensorPin);
Serial.println(sensorValue);
val = map(sensorValue, 0, 1023, 1, 8);
}

void loop()
{ buttonState = digitalRead(buttonPin);

if (buttonState == HIGH)
{
for(pos = 30; pos < 120; pos += val) 
{ 
    myservo.write(pos); 
    delay(15); 
    sensorValue = analogRead(sensorPin);
    Serial.println(sensorValue);
    val = map(sensorValue, 0, 1023, 1, 8);
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License