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

ConnectTheDots with Particle Azure IoT Hub Integration
Intermediate
  • 559
  • 7

Protip

This project will allow you to connect your Particle device into an Azure IoT Hub for viewing data in real-time through an ASP.NET web app!

Other Clocks
Intermediate
  • 183
  • 3

Work in progress

A combination of 3 different clocks in one frame.

Christmas Gift Box
Intermediate
  • 3,602
  • 595

Full instructions

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

Weather Aware Sprinkler Controller
Intermediate
  • 1,296
  • 16

Full instructions

6 station Photon controller uses the Weather Underground API to prevent watering when windy, rainy, or too cold.

Simple Environmental Monitoring
Intermediate
  • 1,553
  • 13

Full instructions

Particle Photon circuit allowing the display of environmental conditions (light, temperature, humidity, pressure) using the Blynk app.

THDweeter
Intermediate
  • 249
  • 2

Protip

Yet another temperature-humidity sensor publishing to dweeter, with WiFi auto-disconnect and a push button to read daily max and min values.

ProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login