Things used in this project

Code

"Blink" example codeC/C++
Streamlined so that you can change the LED's pin number in just one place. 0 is the big red LED, on the main board; 2 is the little blue one on the ESP module.
/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.

  Most Arduinos have an on-board LED you can control. On the Uno and
  Leonardo, it is attached to digital pin 13. If you're unsure what
  pin the on-board LED is connected to on your Arduino model, check
  the documentation at http://www.arduino.cc

  This example code is in the public domain.

  modified 8 May 2014
  by Scott Fitzgerald
 */

const int blinkMe = 0;

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(blinkMe, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(blinkMe, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(blinkMe, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}
IFTTT + Twitter codeC/C++
Sends the event "feather_a" to IFTTT.com, so you can trigger actions (such as posting a tweet). Add your own access key and WiFi details.
/*
 Simple HTTP get webclient test
 Modified from https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/using-arduino-ide#connecting-via-wifi
 */
 
#include <ESP8266WiFi.h>
 
const char* ssid     = "NETWORK";
const char* password = "NET-PASSWORD";
 
const char* host = "maker.ifttt.com";
 
void setup() {
  Serial.begin(115200);
  delay(100);
 
  // We start by connecting to a WiFi network
 
  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
  
  WiFi.begin(ssid, password);
  
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
 
  Serial.println("");
  Serial.println("WiFi connected");  
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
}
 
int value = 0;
 
void loop() {
  delay(300000);
  ++value;
 
  Serial.print("connecting to ");
  Serial.println(host);
  
  // Use WiFiClient class to create TCP connections
  WiFiClient client;
  const int httpPort = 80;
  if (!client.connect(host, httpPort)) {
    Serial.println("connection failed");
    return;
  }
  
  // We now create a URI for the request
  String url = "/trigger/feather_a/with/key/MYKEY";
  Serial.print("Requesting URL: ");
  Serial.println(url);
  
  // This will send the request to the server
  client.print(String("GET ") + url + " HTTP/1.1\r\n" +
               "Host: " + host + "\r\n" + 
               "Connection: close\r\n\r\n");
  delay(500);
  
  // Read all the lines of the reply from server and print them to Serial
  while(client.available()){
    String line = client.readStringUntil('\r');
    Serial.print(line);
  }
  
  Serial.println();
  Serial.println("closing connection");
}

Credits

Tmp image 0?auto=compress%2cformat&w=60&h=60&fit=min
Alex Glow

The Hackster team's resident Hardware Nerd. I like robots, music, EEG, wearables, and languages. FIRST Robotics kid.

Thanks to Drew Alden.

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

IoT NTC thermistor temps using thethings.iO
Easy
  • 382
  • 11

Full instructions

Using the mcThings IoT platform and NTC thermistors, display the incoming real-time information into thethings.iO IoT dashboard!

Arduino 101 - Intel Curie Pattern Matching Dress
Easy
  • 2,009
  • 19

Full instructions

A dress with Curie's pattern matching engine on Arduino101 to control the embedded LEDs, which makes constellations show up on the dress.

C++ LCD Display Driver for IOT2020
Easy
  • 146
  • 5

Protip

Hitachi LCD displays are used in many designs. If you're building a C++ project, this driver class can help.

Smart Home Sensor Node
Easy
  • 789
  • 6

Full instructions

Build a sensor node using Arduino/Genuino 101 which integrated with openHAB 2, which you can build a smart home control system in no time.

Windows 98 Wrist Watch
Easy
  • 3,779
  • 24

Full instructions

Everyone's favourite Operating System. On your wrist!

Neopixel strip control on ESP8266 with MongooseOS in 3 mins
Easy
  • 55
  • 1

Full instructions

Demo of how to control Neopixel strip on ESP8266 with Mongoose OS. In less than 3 minutes and in a simple JavaScript!

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback