Summary
This simple demo includes a servo motor with a horn that is taped to a wooden chopstick and a cardboard cutout of a hand. Place the device on any surface that will allow you to rest your elbow and wait for a high-five. The high-fives are not consistent, however, and may require a bit of patience.
In the code, I used the random() function to generate a number between 0 and 100 and if that number is divisible by 7, the device will give you a high-five. Otherwise, it won’t. By introducing some randomness into the demo, it gives the device a more human aspect, as if its high-fives were given on a whim or a decision of its own rather than a consistent and mechanical action often seen in industrial robots. It makes the experience of waiting for a high-five more interesting, exciting, and perhaps even thrilling since you don’t know when exactly the device will decide to give you that high-five. But patience rewards you in the end and eventually, it will grant the high-five that participants seek upon initial interaction with the device. I also tried to make the actual action of the high-five more human by having the ascent of the arm faster than its descent.
My inspiration for this came from my cat. I tried to teach him to give me his paw and after half an hour of patiently waiting and trying, he finally did. I wanted to re-create that same feeling of not knowing whether or not you’ll get a result and patiently waiting until the universe (or in my case, my cat) responds. You can’t possibly control everything in your life, so sometimes it’s okay to just wait and see what the world gives you.
Video
Video & cardboard hand cutout credit: Victor Song
Code
#include <Servo.h> const int PIN = 7; Servo hand; void setup() { hand.attach(PIN); hand.write(0); } void loop() { // generate random number int num = random(0,100); if (num % 7 == 0) { // ascending for (int i = 0; i < 90; i+=15) { hand.write(i); delay(50); } // descending for (int i = 90; i > 0; i-=5) { hand.write(i); delay(40); } delay(500); } delay(1000); }
Leave a Reply
You must be logged in to post a comment.