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

Mushroom  cultivation
Easy
  • 277
  • 7

Control the parameters of temperature, humidity, lighting and check the access to the crop to automate the process.

Security system and temperature monitor for your home
Easy
  • 121
  • 0

Full instructions

This system sends alerts to your smartphone when there is movement in the house, also allows monitoring the temperature of the place.

Internet button on ESP8266 and Amazon AWS IoT in 2 minutes
Easy
  • 338
  • 5

Protip

Mongoose OS is an open source operating system for the Internet of Things targeting commercial applications. Mongoose OS currently works ...

Programming 8x8 LED Matrix
Easy
  • 309
  • 3

Protip

Send Bytes to an 8x8 LED Matrix

MQTT & MicroPython
Easy
  • 209
  • 0

Protip

Get started subscribing and publishing messages, in MicroPython, using MQTT!

Alarm Clock
Easy
  • 731
  • 7

Protip

Alarm Clock with Arduino

ProjectsCommunitiesContestsLiveJobsBetaFree StoreBlogAdd projectSign up / Login
Respect project