Paul Niculescu
Published © GPL3+

Lane Tech HS- PCL- Lazy Susan

An alexa-automated surface that turns on command

IntermediateFull instructions provided5 hours45
Lane Tech HS- PCL- Lazy Susan

Things used in this project

Hardware components

MAKERFACTORY Robot Servo MF-06
MAKERFACTORY Robot Servo MF-06
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Argon
Particle Argon
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
Amazon Alexa service
IFTTT Amazon Alexa service

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)
Scissor, Electrician
Scissor, Electrician

Story

Read more

Schematics

Project plan

Code

Lazy Susan code

C/C++
Servo myServo;

bool isturned;
int count = 0;
void setup()
{
    myServo.attach(2);
    myServo.write(10);
    delay(500);
    Particle.function("homeauto", homeautoServo);
    Particle.function("turnBack", turnBack);
    Particle.function("turnfull", turnfull);
    Particle.function("turnhalf", turnhalf);
}

void loop()
{
    // do nothing
}

int homeautoServo (String param)
{
    myServo.write(90);
    delay(200);
    
    return -1;
}

int turnBack (String param)
{
    myServo.write(10);
    delay(200);
    
    return-1;
}

int turnfull (String param)
{
    myServo.write(170);
    delay(200);
    
    return -1;
}

int turnhalf (String param)
{
    myServo.write(45);
    delay(200);
    
    return -1;
}
/*
void loop()
{
    if (isturned==false)
    {
        myServo.write(170);
         delay(500);
    }
    if(isturned==true)
    {
        myServo.write(15);
        delay(500);
    }
}

int homeautoServo (String param) {
    
    if(count == 0)
    {
        isturned=false;
        count=1;
    }
    else if(count==1)
    {
        isturned=true;
        count=0;
    }
    return 0;
}

*/

Credits

Paul Niculescu

Paul Niculescu

1 project • 0 followers

Comments

Add projectSign up / Login