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

Pool Buddy
Intermediate
  • 250
  • 5

Work in progress

Monitor and log water quality (pH & ORP) and temperature from everywhere.

Particle Photon Flip Dot Clock
Intermediate
  • 1,928
  • 30

Full instructions

The flip dot display uses an electromechanical dot matrix that spin from black to yellow to display text, numbers and more!

IoT Thermometer Using Python
Intermediate
  • 310
  • 3

Full instructions

How to develop a simple, but powerful, IoT thermometer using a Zerynth-powered single-board MCU and the Zerynth App.

Patriot iOS App
Intermediate
  • 514
  • 9

Use an old iPhone device to control and display the status of your Patriot IoT devices.

Patriot iOS App

Team Patriot

Do You Know How Your Plants Are Feeling? [Particle+Ubidots]
Intermediate
  • 145
  • 3

Full instructions

Build and deploy a soil moisture and temperature sensor for commercial greenhouses or private garden monitoring and treatment.

Full Color Alexa Controlled Lights - FastLED & Photon
Intermediate
  • 482
  • 9

Full instructions

Full color light controlled by Alexa. Step by step! Using a Particle Photon and configurable Python Script in Lambda.

ProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Feedback