William Bethke
Published

Lane Tech - PCL - Dog Adoption Checker

Have a dog start barring his teeth if not enough dogs are being adopted.

BeginnerWork in progress46
Lane Tech - PCL - Dog Adoption Checker

Things used in this project

Hardware components

SG90 Micro-servo motor
SG90 Micro-servo motor
×1
Argon
Particle Argon
×1
Perma-Proto Breadboard Half Size
Perma-Proto Breadboard Half Size
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

Linear Servo Actuator Pinion Gear

This was found at https://www.thingiverse.com/thing:3170748/files

Linear Servo Actuator Pusher Bar

This was found at https://www.thingiverse.com/thing:3170748/files

Linear Servo Actuator Motor Bracker

This was found at https://www.thingiverse.com/thing:3170748/files

Schematics

Schematic

Code

Final Project Code

C/C++
Servo myservo;
int servPin = 5;
int angle = 0;
int timercheck = 0;
double retainer = 0;

void setup()
{
  myservo.attach(servPin);
  myservo.write(angle);
  Particle.subscribe("hook-response/Dog_Update2", myHandler, MY_DEVICES);
  
}

void loop()
{
Particle.publish("Dog_Update2");
timercheck++;
delay(10000);
}

void myHandler(const char *event, const char *data) {
{
    
    double adoptedDate = atof(data);
    if (timercheck == 10){
        if (adoptedDate == retainer){
            if (angle != 90){
                angle = angle + 90;
            }
            myservo.write(angle);
            delay(1000);
            timercheck = 0;
        }} else if (adoptedDate != retainer){
        timercheck = 0;
        angle = 0;
        myservo.write(angle);
        delay(1000);
        retainer = adoptedDate;
    }
}
}

Credits

William Bethke

William Bethke

2 projects • 2 followers

Comments

Add projectSign up / Login