Skip to content

Instantly share code, notes, and snippets.

#define BUILDIN_LED 2
#define ledPIN1 23
#define ledPIN2 22
// ----------------------------------------------------------------------------------
void first_task(void *pvParameter){
/* Configure the IOMUX register for pad BLINK_GPIO (some pads are
muxed to GPIO on reset already, but some default to other
functions and need to be switched to GPIO. Consult the
Technical Reference for a list of pads and their default
@prasertsakd
prasertsakd / thinkspeak_rest.ino
Created April 14, 2015 06:53
Thinkspeak Post Data
#include <ESP8266WiFi.h>
const char* ssid = "-----------";
const char* password = "-----------";
// ThingSpeak Settings
char thingSpeakAddress[] = "api.thingspeak.com";
String writeAPIKey = "----------------------";
const int updateThingSpeakInterval = 15 * 1000; // Time interval in milliseconds to update ThingSpeak (number of seconds * 1000 = interval)
/*
Udp NTP Client
Get the time from a Network Time Protocol (NTP) time server
Demonstrates use of UDP sendPacket and ReceivePacket
For more on NTP time servers and the messages needed to communicate with them,
see http://en.wikipedia.org/wiki/Network_Time_Protocol
created 4 Sep 2010
/*
* This sketch shows the WiFi event usage
*
* In this example you can receive and process below events.
* Refer to ESP8266WiFiType.h
*
typedef enum {
WIFI_EVENT_STAMODE_CONNECTED = 0,
WIFI_EVENT_STAMODE_DISCONNECTED,
WIFI_EVENT_STAMODE_AUTHMODE_CHANGE,
#include <ESP8266WiFi.h>
#include <WiFiUDP.h>
WiFiUDP UDP;
const char* ssid = "sensorNode";
const char* password = "1234567890";
boolean wifiConnected = false;
//midi test
void setup() {
// Initialise Serial connection
Serial.begin(115200);
//midi
//nodemcu use pin D4 for TX
Serial1.begin(31250);
/**
* ControlP5 Button
* this example shows how to create buttons with controlP5.
*
* find a list of public methods available for the Button Controller
* at the bottom of this sketch's source code
*
* by Andreas Schlegel, 2012
* www.sojamo.de/libraries/controlp5
*
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <Adafruit_NeoPixel.h>
WiFiUDP Udp;
Adafruit_NeoPixel strip = Adafruit_NeoPixel(5, 5, NEO_GRB + NEO_KHZ800);
const char* ssid = "...............";
const char* password = "........................";
byte seven_seg_digits[11][7] = { { 1,1,1,1,1,1,0 }, // = 0
{ 0,1,1,0,0,0,0 }, // = 1
{ 1,1,0,1,1,0,1 }, // = 2
{ 1,1,1,1,0,0,1 }, // = 3
{ 0,1,1,0,0,1,1 }, // = 4
{ 1,0,1,1,0,1,1 }, // = 5
{ 1,0,1,1,1,1,1 }, // = 6
{ 1,1,1,0,0,0,0 }, // = 7
{ 1,1,1,1,1,1,1 }, // = 8
{ 1,1,1,1,0,1,1 }, // = 9
int ledPin;
int timeDelay;
int ledup = {6,7,8,9,10,11,12,13,12,11,10,9,8,7,6};
void setup() {
for (ledPin = 0;ledPin<=8;ledPin++) {
pinMode( ledup[ledPin], OUTPUT);
}
}