Things used in this project

Hardware components:
Core
Particle Spark Core
$39
×1
Arduino Sidekick Basic Kit
For male-to-male cables, a button, and a resistor. You can buy this kit for $34.99 at Radio Shack, and is a useful kit to have on hand.
×1
Software apps and online services:
Eipgsd2k
Twitter

Schematics

Diagram
Wiring diagram
Unnamed

Code

file_8967.txtC/C++
kid-summoner.ino
/*
  kid-summoner.ino
 
    On pressing a button, a tweet is sent via Pushingbox
    Written for the Spark Core
*/

int inputPin = D1; //push-button pin
int val = 0; //variable for push-button status
int state = 1; //variable for on/off state

const char * DEVID = the-devid-created-in-pushingbox";         // Scenario: "Tweet"
const char * serverName = "[api.pushingbox.com](http://api.pushingbox.com)";   // Pushingbox API URL

TCPClient client;

void setup() {
   
    pinMode(inputPin, INPUT);
    Serial.begin(9600);
}


void loop() {
    val = digitalRead(inputPin); //read the state of the push-button
   
    if (val == LOW) { //if push-button pressed
        state = !state; //reverse on/off state
        delay(250); //primitive button debounce
        Serial.println("button pushed!");
        sendToPushingBox(DEVID);
       
    }
}

void sendToPushingBox(const char * devid)
{
    client.stop();
    if (client.connect(serverName, 80)) {
        client.print("GET /pushingbox?devid=");
        client.print(devid);
        client.println(" HTTP/1.1");
        client.print("Host: ");
        client.println(serverName);
        client.println("User-Agent: Spark");
        client.println();
        client.flush();
       
    }
    else{
        Serial.println("connection failed");
    }
} 

Credits

7a2730fc6fd826ace7f1ce9bcabee05b
Jen Looper

Founder: http://t.co/DOXReolRYV, indie web and mobile developer, Developer Relations team member at Telerik. Queen of the Apps!

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Particle Photon Based Security System with Alerting
Intermediate
  • 1,372
  • 20

Full instructions

Be alerted to any door or window opening and closing in your house on your smart phone.

Happy Plant Notifier
Intermediate
  • 299
  • 5

Full instructions

Get a text or call if your plant is getting too dry, along with a nice LCD display giving information regarding your plant's health.

My Guardian for the Workshop
Intermediate
  • 210
  • 4

Full instructions

Device will send emails if the door or window has been opened, and will monitor the temperature and humidity of the place.

Smart and Safe Outdoor Plant Watering System
Intermediate
  • 2,543
  • 18

Monitors soil moisture and weather forecasts to give plants just the water they need. Safe garden hose hookup for season long watering.

Christmas Gift Box
Intermediate
  • 3,686
  • 595

Full instructions

Christmas Gift Box plays music and sends an email when it is opened.

Carbon Fiber Vacuum Chamber
Intermediate
  • 3,042
  • 94

Full instructions

Our project is a carbon fiber vacuum chamber that is monitored by multiple particle photons and various sensors.

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaFree StoreBlog