Skip to content

Instantly share code, notes, and snippets.

@teos0009
Last active November 6, 2015 08:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teos0009/4354504e8d990e81ba00 to your computer and use it in GitHub Desktop.
Save teos0009/4354504e8d990e81ba00 to your computer and use it in GitHub Desktop.
//Single Appreciation Day (SAD)
//auto hot dater powered by arduino
#include <Servo.h>
Servo myservo;
int pos = 0; // variable to store the servo position
long rndMatch;
int swipeCount = 0;
void setup()
{
myservo.attach(7); // attaches the servo on pin 7 to the servo object
randomSeed(analogRead(0));
}
void loop()
{
// print a random number from 0 to 1
rndMatch = random(2);
int rndDelay = random(500);
delay(rndDelay); // dont swipe too often to counter bot detection
//0.5 chance of swipe left or right on tinder
//rndMatch can be used with openCV on a set of trained data consist of preferred female/male pictures
if (rndMatch == 0){
swipeLeft();
swipeCount++;
}
else if(rndMatch == 1){
swipeRight();
swipeCount++;
}
else{
rndMatch = random(2);
}
}//end loop
void swipeLeft(){
for(pos = 90; pos <= 180; pos += 1)
{
myservo.write(pos);
delay(10);
}
for(pos = 180; pos >=90; pos -= 10)
{
myservo.write(pos);
delay(15);
}
}//end swipeLeft
void swipeRight(){
for(pos = 90; pos >= 0; pos-=1)
{
myservo.write(pos);
delay(10);
}
for(pos = 0; pos <= 90; pos+=10)
{
myservo.write(pos);
delay(15);
}
}//end swipeRight
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment