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.

Contact
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

PHPoC: Web-Based Thermometer
Easy
  • 275
  • 12

Full instructions

This project allows you to check the temperature at home from anywhere using a web browser.

Sorting Hat: Circuit Playground Express Starter Project
Easy
  • 112
  • 3

Protip

Which Hogwarts House do you belong in? A quick first project for this beginner-friendly board from Adafruit.

NeoPixel Thermometer!
Easy
  • 329
  • 5

Full instructions

Transforms a NeoPixel ring into a cool thermometer

Electronic Voting Machine Using Arduino
Easy
  • 256
  • 5

It is an EVM using Arduino. There are five switches in all, assigned for various activities.

Arduino - Web-Based Thermometer
Easy
  • 1,306
  • 17

Full instructions

This project allows you to check temperature at home from anywhere using web browser.

Retro Nokia Snake Game with Arduino
Easy
  • 4,092
  • 28

Full instructions

Ever wish you could go back to the happy 90's and play snake on your old Nokia phone? Grab on to your joystick for this blast-from-the-past.

ProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login