Skip to content

Instantly share code, notes, and snippets.

@bbx10
bbx10 / esp-wunderground.ino
Created October 29, 2015 15:05
ESP8266 get weather from Weather Underground
/****************************
The MIT License (MIT)
Copyright (c) 2015 by bbx10node@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@bbx10
bbx10 / ESPWebSock.ino
Last active March 3, 2023 22:13
ESP8266 Web server with Web Socket to control an LED
/*
* ESP8266 Web server with Web Socket to control an LED.
*
* The web server keeps all clients' LED status up to date and any client may
* turn the LED on or off.
*
* For example, clientA connects and turns the LED on. This changes the word
* "LED" on the web page to the color red. When clientB connects, the word
* "LED" will be red since the server knows the LED is on. When clientB turns
* the LED off, the word LED changes color to black on clientA and clientB web
@bbx10
bbx10 / ESPHrefControl.ino
Created July 21, 2015 04:13
Demonstrate using an http server and HTML href to control an LED. The http server runs on the ESP8266.
/*
* Demonstrate using an http server and HTML href to control an LED.
* The http server runs on the ESP8266.
*
* Connect to "http://esp8266HrefControl.local" or "http://<IP address>"
* to bring up an HTML page to control the LED connected GPIO#0. This works
* for the Adafruit ESP8266 HUZZAH but the LED may be on a different pin on
* other breakout boards.
*
* Imperatives to turn the LED on/off using a non-browser http client.
@bbx10
bbx10 / ESPWebForm.ino
Created July 21, 2015 03:31
Demonstrate using an http server and an HTML form to control an LED. The http server runs on the ESP8266.
/*
* Demonstrate using an http server and an HTML form to control an LED.
* The http server runs on the ESP8266.
*
* Connect to "http://esp8266WebForm.local" or "http://<IP address>"
* to bring up an HTML form to control the LED connected GPIO#0. This works
* for the Adafruit ESP8266 HUZZAH but the LED may be on a different pin on
* other breakout boards.
*
* Imperatives to turn the LED on/off using a non-browser http client.
@bbx10
bbx10 / vibration.ino
Created July 13, 2015 22:12
ESP8266 vibration switch demo
/*
* Vibration switch demo for ESP8266
*
* Blink the LED and print debug info when the
* switch makes/breaks contact.
*
* The switch is connected between GPIO#2 and GND. The
* switch is open when still and closes briefly when
* shocked/vibrated. In fact, it closes and opens
* many times very quickly.
@bbx10
bbx10 / mqtt_basic.ino
Created June 8, 2015 01:55
Arduino mqtt_basic.ino modified for ESP8266
/*
Basic MQTT example modified for ESP8266 WiFi
- connects to an MQTT server
- publishes "hello world" to the topic "outTopic"
- subscribes to the topic "inTopic"
Arduino IDE 1.6.4
ESP8266 1.6.4-673-g8cd3697
MQTT client library from