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!

Replications

Did you replicate this project? Share it!

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

Give feedback

Comments

Similar projects you might like

Drop of Life
Intermediate
  • 666
  • 17

Full instructions

A display to remind me when I can donate blood and save lives, powered by the Red Cross API and Particle.

IoT Drone - Part 2 - Sensors
Intermediate
  • 527
  • 8

Work in progress

Part 2 incorperates a GPS receiver, 10 DOF IMU, and Ultrasonic distance sensor to be used for flight controls.

How to run Particle on Raspberry Pi (Headless on Pi Zero W)
Intermediate
  • 1,679
  • 19

Protip

Use the most popular single-board computer with the most popular IoT tools.

Your Wife is Hot!
Intermediate
  • 608
  • 6

Full instructions

Not hot like she looked at your browser history, hot as in temperature hot! This can be avoided with an A/C Condensate Monitoring System.

Your Wife is Hot!

Team Is it Summer Yet?

Wireless Tank and Pump Monitoring System with Mobile App
Intermediate
  • 515
  • 3

Particle and Blynk to wirelessly monitor a 4,000 gallon water distribution system.

IoT Controlled Planter Lights
Intermediate
  • 560
  • 6

This is a shelf for starting plant seeds, controlled over the internet with automatic lights.

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback