annavssiulung
annavssiulung_X
lethardplasticbeelectrocuted_connectionweb
lethardplastic
lethardplastic_chansiul
lethardplastic_annac

Let hard plastic get electrocuted !讓硬塑料被電吧!

Game
Micro Processor, relay, push button, digital massage therapy machine

2016 Jan

Game instruction

2 players in one game.  Each player will have a push button on hand and one set of massage pad on face (or other body part)

When Player A pressed A’s button, this will connect the circuit to make therapy pulse [attack]  to player B through the massage pad  from the therapy massage machine. Player B can press the push button to cancel the circuit connection [defense] ,

and vice versa.

When Player B pressed B’s button, this will connect the circuit to make therapy pulse [attack] to player B through the massage pad from the therapy massage machine. Player A can press the push button to cancel the circuit connection [defense] , and vice versa.

** The circuit completion is done by electronic relay controlled by a micro processor. It is not identifical to an instant attack which the timing of pulse generation depended on the mode of massage therapy machine.

When both player A and player B pressed and hold the buttons for 3 seconds, both sets of massage pad circuit will be connected for 1 seconds.

When no one is pressing button for 5 seconds, both sets of massage pad circuit will be connected for 1 seconds.

After the preparation, turn on the digital therapy massage machine and select the mode and straightness of massage pulse to start the game.

No time limit for the game. The game stop until any one surrender. or please decide the winning condition before game start.

 

遊戲玩法:

雙方各有一粒按扭,雙方臉部(或其他)地方貼上經絡治療器貼片。

當A君按下按扭,會接通B君上的電(攻擊),B君可按自己手上的按扭來關電(防守),如是者
當B君按下按扭,會接通A君臉上的電(攻擊),A君可按自己手上的按扭來關電(防守)
**上面所講的接上電,其實只是用繼電器把供電貼片的電路接上,並不代表立即被電,是關取決於經絡治療器的模式(如按摩、搥擊、針灸、推拿等)。

當雙方同時按下維持三秒,將雙方的的貼片會同時供電一秒

當沒有任何按扭事件發生維持五秒,將雙方的的貼片會同時供電一秒

當雙方準備完畢,即可閞動經駱治療器,選擇按摩的模式及強度。

時限沒有,直到任何一方投降為止,或於開賽前想好一個分勝負的方法。

schematic diagram / structure

 

Arduino CODE:

code:
//Let the hard plastic be electrocuted V1.1
//Variables
 const int Playerbutton1pin = 2; // player1button Pin
 const int Playerbutton2pin = 3; // player2button Pin
 const int player1shock = 13; // the number of the LED pin
 const int player2shock = 12;
 const int player1shockled = 9;
 const int player2shockled = 8;
 //const int bothpressingled = 2;
 const int bothpressled = 5;
 boolean pressatthesametime ;
 boolean noonepress;
 // variables will change:
 int buttonState = 0;
 int buttonState2 = 0;
 int presslimit = 75;
 int player1threesecondtimer;
 int player2threesecondtimer;// variable for reading the pushbutton status
 int bothpresstimer;
 int emptytimer;
 //int brightness;
 void setup() {
 // initialize the LED pin as an output:
 //Serial.begin(9600);
 pinMode(player1shock, OUTPUT);
 pinMode(player2shock, OUTPUT);
 pinMode(bothpressled, OUTPUT);
 //pinMode(bothpressingled, OUTPUT);
 pinMode(player1shockled, OUTPUT);
 pinMode(player2shockled, OUTPUT);
 // initialize the pushbutton pin as an input:
 pinMode(Playerbutton1pin, INPUT);
 pinMode(Playerbutton2pin, INPUT);
 Serial.begin(9600);
 }
 void loop(){
 digitalWrite(player1shock, LOW);
 digitalWrite(player2shock, LOW);
 digitalWrite(bothpressled, LOW); //unflash LED
 // digitalWrite(bothpressingled, LOW); //unflash LED
 digitalWrite(player2shockled, LOW); //unflash LED
 digitalWrite(player1shockled, LOW); //unflash LED
 *if (player2threesecondtimer > presslimit) {
 player2threesecondtimer = 0;
 }
 if (player1threesecondtimer > presslimit) {
 player1threesecondtimer = 0;
 }*/
 // read the state of the pushbutton value:
 buttonState = digitalRead(Playerbutton1pin);
 buttonState2 = digitalRead(Playerbutton2pin); 
 if ((buttonState2 == HIGH) && (buttonState == HIGH)){
 digitalWrite(bothpressled, HIGH); //flash LED
 Serial.print ("both button pressed for");
 bothpresstimer++;
 // brightness = map(bothpresstimer,0,74,100,255);
 //analogWrite(bothpresstimer, brightness);
 Serial.println (bothpresstimer); 
 //CASE 1 -- IF both pressed more than limit
 if (bothpresstimer==75){
 Serial.println ("BOTH holding too long , need electricity");
 digitalWrite(player1shock, HIGH);
 digitalWrite(player2shock, HIGH);
 digitalWrite(player1shockled, HIGH);
 digitalWrite(player2shockled, HIGH);
 bothpresstimer = 0;
 delay(1500);
 digitalWrite(player1shock, LOW);
 digitalWrite(player2shock, LOW);
}
} else {
bothpresstimer = 0;

}
if ((buttonState2 == LOW) && (buttonState == LOW)){
Serial.print ("no one press button for");
emptytimer++;
//analogWrite(A0, emptytimer);
Serial.println (emptytimer);
if (emptytimer==160){
Serial.println ("so boring , need electricity");
digitalWrite(player1shock, HIGH);
digitalWrite(player2shock, HIGH);
digitalWrite(bothpressled, HIGH); //flash LED
digitalWrite(player2shockled, HIGH);
digitalWrite(player1shockled, HIGH);
emptytimer = 0;
delay(1500);
digitalWrite(player1shock, LOW);
digitalWrite(player2shock, LOW);
}
} else {
emptytimer = 0;
}
//CASE 2 -- IF Player 1 press , player 2 dont press
if ((buttonState == HIGH) && (buttonState2 == LOW)){
digitalWrite(player2shock,HIGH);
Serial.println ("player 2 shock");
digitalWrite(player2shockled,HIGH);
digitalWrite(player1shock, LOW);
digitalWrite(player1shockled, LOW);
}
//CASE 3 -- IF PLayer 2 press, player 1 dont press
if((buttonState == LOW) && (buttonState2 == HIGH)){
digitalWrite(player1shock,HIGH);
Serial.println ("player 1 shock");
digitalWrite(player1shockled,HIGH);
digitalWrite(player2shock, LOW);
digitalWrite(player2shockled, LOW);
} else {
}
}

 

讓硬塑料被電吧 大戰 } Open Battle – Let hard plastic get electrocuted
15.01.2016 (五|Fri) 7:30pm

賽制:目標有16位玩家,以淘汰賽進行。
最後勝利將獲增
請留名或pm報名,或於當晚七時二十九分前即場報名
**心臟病、高血壓、有膽但淆底之人仕不宜參戰,請移玉步到花生席。

 

 

 

 installation set up for the documentation of the open battle

Making of:

Test on face massage

player demo