A Man’s Best Friend

The conversation we created with three servos, two robots and two switches started with a scotty dog and a human. The interaction begins with the motion of the human hand, reaching down to pet the dog’s nose. As there is a switch mounted to the flat of the nose, the dog’s tail and paw then begin wagging and reaching up to shake the human’s hand. When the switch is activated during the exchange in both circumstances, a delay ensues in the motions of the two robots. The person, with a switch on the underside of it’s passive arm, neglects to move at the flick of it’s switch and when released, continues. After about 30 seconds, if the dog is not pet on the nose with the switch, all motions halt.

The signaling is visible to the user viewing this robotic interaction and is physical in that each robot must use it’s programmed force to activate one another.

*Demo 3 Continued

Solidworks: https://drive.google.com/drive/folders/1e7KIp94aQCVFE5KsSVIcX4y6npOH2uYF?usp=sharing

Dog: 


#include <Servo.h>
Servo tail;
Servo arm;
const int switchPin = 3;
const int tailPin = 10;
const int armPin = 9;

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
tail.attach(tailPin);
tail.write(0);
arm.attach(armPin);
arm.write(0);

pinMode(switchPin, INPUT);
}

void loop() {
if(digitalRead(switchPin) == HIGH) {
wagTail();
delay(1000);
shakePaw();
}
delay(50);
// put your main code here, to run repeatedly:

}

void wagTail() {
for(int i=0; i < 3; i++) {
tail.write(180);
delay(500);
tail.write(0);
delay(500);
}
}

void shakePaw() {
arm.write(90);
delay(500);
arm.write(120);
delay(200);
arm.write(60);
delay(200);
arm.write(120);
delay(200);
arm.write(0);
}

Person:


#include <Servo.h>
Servo person;
const int switchPin = 3;
const int servoPin = 9;

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
person.attach(9);
person.write(0);
pinMode(switchPin, INPUT);
}

void loop() {
if(digitalRead(switchPin) == HIGH) {
petDog();
}
delay(50);
// put your main code here, to run repeatedly:

}

void petDog() {
for(int i=0; i < 3; i++) {
person.write(90);
delay(900);
person.write(0);
delay(300);
}

}