Skill dev 4 - Miley Hu

Made by Miley Hu

Created: December 4th, 2021

0
int servoPin = A3;
Servo myServo;
int servoPos = 0;

void setup() {
    myServo.attach( A3 );
    
    Particle.function("servoStart", servoStart);
    Particle.function("servoEnd", servoEnd);
    Particle.variable(  "servoPos" , &servoPos , INT );
}


void loop() {
    
}


int servoStart(String command){
    for (servoPos = 0; servoPos <= 180; servoPos += 1) { // goes from 0 degrees to 180 degrees
    // in steps of 1 degree
        myServo.write(servoPos);              // tell servo to go to position in variable 'pos'
        delay(15);                       // waits 15ms for the servo to reach the position
        }
 

   // done
   return 1;
}

int servoEnd(String command) {
    for (servoPos = 180; servoPos >= 0; servoPos -= 1) { // goes from 180 degrees to 0 degrees
        myServo.write(servoPos);              // tell servo to go to position in variable 'pos'
        delay(15);                       // waits 15ms for the servo to reach the position
    }
    
    return 1;
}
Click to Expand
0

This is a little sketch to indicate someone's availability using a servo and IFTTT connecting to someone's zoom account. When a zoom meeting starts for this person, the indicator will shift to "busy". When it ends, it shifts back to "available".

0
Skill Dev 4 - Motor
Miley Hu - https://youtu.be/gUa7UKe1uvY
x