Skills Dev IV _xuyangj

Made by Xuyang Jin · UNLISTED (SHOWN IN POOLS)

Get oriented with output and feedback by working with an actuator.

Created: December 8th, 2020

0

Intention

In this project, I worked with the servo and create a communication with google drive and servo. 

Process

First I write the function and type the position input to change the servo position. So I call it in the console to test the function.

0
int servoPin = A3;
Servo servo;
bool servoPositionUpdated = false;
int servoPosition = 0;

void setup() {
// attaches the servo on the A3 pin to the servo object
  servo.attach( servoPin );

   //Register our Particle to control the servo
   Particle.function("pos", setPosition);

  // Keep a cloud variable for the current position
}

void loop() {

    if (servoPositionUpdated == true){
        servo.write(servoPosition);
        servoPositionUpdated = false;
    }
}

int setPosition(String command)
{
    // Convert
   int value = command.toInt();
   if( value >180 ) {
       return -1;
    }
   if( value < 0 ) {
       return -1;
    }

    servoPosition = value;
    servoPositionUpdated = true;
}
Click to Expand
0
0

Then I used IFTTT to link Google Drive to my particle. So the servo will be a signal of a new file added in Google Drive folder.  When a new file added in the Google Drive, it will trigger the function setPosition and the servo will change the position.

0
0

Then I tried different Paper Signals on my Servo. I tried to build an umbrella on it and when a new file added, the umbrella will be open. While the paper is not easy to fold so it is ok when the new file adds to Drive and the umbrella is open but it is weird when no file added and the umbrella is folded. 

So I change the idea into an icon shows 'new file in Drive' and the servo will change the cover when the function are called. See the video below.

0
0

Reflection

The process went on smoothly and everything works as required. The project is a great indicator and has great potential for different interesting events. I built the connection with google calendar and pixel last time via IFTTT. This time I tried google drive and I really like the signal/notification. It is good to know how to connect other applications through IFTTT to my circuit and I would like to try more. 

 I was excited but I felt like the servo is not a great actuator. The paper signal is not easy to attach to the servo and the paper is not flexible enough to be a signal. I even felt like the sounds of the movement is more like a proper indicator. I prefer neopixel as we have done for the last Dev practice which is easy to achieve calm device.

Anyway, I felt more confident when I came up with an idea and code it into practice.

x
Share this Project

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


Courses

About

Get oriented with output and feedback by working with an actuator.