Clarissa San Diego
Published © GPL3+

Android Phone Finder Using Particle Photon Internet Button

Find your misplaced phone with the push of a button even if it's on silent or vibrate with the Particle Internet Button and IFTTT.

BeginnerFull instructions provided5,666
Android Phone Finder Using Particle Photon Internet Button

Things used in this project

Story

Read more

Code

Code - Basic Button v.1

C/C++
Code for single button on Particle Internet Button. In this example, I want to use "button3". When button3 is pressed, the LED at the 6 o'clock position will light up purple for a half a second. Since we will be using the cloud and IFTTT, our call function is Particle.publish( ). I've named the event "LocatePhone".
#include "InternetButton.h"

InternetButton b = InternetButton();

uint8_t button1 = 0;
uint8_t button2 = 0;
uint8_t button3 = 0;
uint8_t button4 = 0;
uint8_t buttonAll = 0;
int gaugeCount = 0;


void setup()
{
    b.begin();
}

void loop() 
    {
    if(b.buttonOn(3)){
        if(!button3){
            button3 = 1;
            Particle.publish("LocatePhone",NULL, 60, PRIVATE);
            b.ledOn(6,255,0,255);
            delay(500);
            b.ledOff(6);
        }
    }
    else {button3 = 0;}
}

Credits

Clarissa San Diego

Clarissa San Diego

1 project • 23 followers
Founder of Makerologist

Comments