Call Alert!

Made by Xuan Peng ·

A simple device telling whether there is a call

Created: December 15th, 2023

0

Outcome

Call alert is a simple device using servo to tell users when there is a phone call coming in. I connected it to particle function so that users can decide the range and time of the vibrations according to their needs.

0
//skill dev 4
Servo myServo;

int servoPin = A3;
int servoPos = 0;
int Pos0 = 90;
int Pos1 = 60;
int Pos2 = 120;

int times = 3;

int interval = 200;

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

  //Register our Particle to control the servo
  Particle.function("phone", phone);
  Particle.function("p1", p1);
  Particle.function("p2", p2);

  // Keep a cloud variable for the current position
  Particle.variable(  "servoPos" , &servoPos , INT );
  
}

void phoneRings(int times){
    for(int i = 0; i<times;i++){
        servoPos = Pos1;
        myServo.write( servoPos );
        delay(interval);
        servoPos = Pos2;
        myServo.write( servoPos );
        delay(interval);
    }
    servoPos = Pos0;
    myServo.write( servoPos );

}

void loop() {

}


int phone(String command)
{
    times = command.toInt();
    constrain(times,1,10);
    phoneRings(times);
   // done
   return 1;
}

int p1(String command)
{
    Pos1  = command.toInt();
    constrain(Pos1,20,70);
    phoneRings(times);
   // done
   return 1;
}

int p2(String command)
{
    Pos2  = command.toInt();
    constrain(Pos2,100,160);
    phoneRings(times);
   // done
   return 1;
}
Click to Expand
0

Next Steps

For next steps I want to learn how to connect it to real phone call, maybe start by exploring the IFTTT function. I also want to try if I can use different vibration modes to indicate that a specific person is calling in, so we'd better answer it ASAP!

x
Share this Project

This project is only accessible by signed in users. Be considerate and think twice before sharing.


Courses

48-675 Designing for the Internet of Things

· 11 members

A hands-on introductory course exploring the Internet of Things and connected product experiences.


About

A simple device telling whether there is a call