loading

Addictions are absolute. How perverse they are can depend on your character. Alcohol, heroin, feet. We here at TVMiller prefer the unhealthy consumption of Coca~Cola. When delving deeper in to methodology, we all quickly learn two superior qualities; the aluminum can and the short brief intensity (the ahh) of an initial taste. We attempted to confine those elements in to a machine that sources three methods of activation; a button, a remote control and Jacob, our developing artificial intelligence.

// CokeShot
// TVMiller

#include IRremote.h

int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;

int red = 8;
int green = 9;
int pour = 10;

int timepour = 10000;
int timeend = 3000;

void setup() {

  Serial.begin(9600);

  pinMode(red, OUTPUT);
  pinMode(green, OUTPUT);
  pinMode(pour, OUTPUT);

  irrecv.enableIRIn();

}

void loop() {

  digitalWrite(red, LOW);
  digitalWrite(green, LOW);
  digitalWrite(pour, LOW);

  // Jacob
  if (Serial.available()) {
    char ser = Serial.read();
    switch (ser) {
    case 'C':
      coke();
      break;
    }
  } 
  // Remote (Any)
  else if (irrecv.decode(&results)) {
    coke();
    irrecv.resume();
  }

}

void coke() {
  digitalWrite(pour, HIGH);
  digitalWrite(green, HIGH);
  delay(timepour);
  digitalWrite(pour, LOW);
  digitalWrite(green, LOW);
  digitalWrite(red, HIGH);
  delay(timeend);
}

About This Instructable

47views

2favorites

License:

Bio: Privateer
More by TVMiller:Arduino Splash Resistant Toilet Foamer Arduino Motion Mute 1992 Isuzu Trooper Windshield Wiper Single Button Hack 
Add instructable to: