Skills Dev IV : Yashasvi

Made by ytulchiy · UNLISTED (SHOWN IN POOLS)

Working with Servo and connecting it to IFTTT

Created: December 13th, 2020

0

Step 1

To write up a basic code for servo and setting up the connection

0
int servoPin = A3;

Servo myServo;

bool servoPositionUpdated = false;
int servoPosition = 0;

void setup() {
    
    myServo.attach(servoPin);
    Particle.function("pos", setPosition);

}

void loop() {
    
    if (servoPositionUpdated == true){
        
        myServo.write(servoPosition);
        servoPositionUpdated = false;
        
    }

}

int setPosition(String command){
    
    int value = command.toInt();
    if (value>180) {
        
        return -1;
    }
    if (value<0){
        
         return -1;
    }
    
    servoPosition = value;
    servoPositionUpdated = true;
    
    
}
Click to Expand
0

Step 2

Connecting the servo to google calender  using IFTTT to give reminder 15 min before the start of the event

x
Share this Project

This project is only listed in this pool. Be considerate and think twice before sharing.


Courses

About

Working with Servo and connecting it to IFTTT