Last active
November 6, 2015 08:54
-
-
Save teos0009/4354504e8d990e81ba00 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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