Skip to content

Instantly share code, notes, and snippets.

int stp = 4; //connect pin 13 to step
int dir = 5; // connect pin 12 to dir
int a = 0; // gen counter
void setup()
{
pinMode(stp, OUTPUT);
pinMode(dir, OUTPUT);
digitalWrite(dir, 0);
}
@woodif
woodif / ESP8266_Shield_Nano.ino
Last active August 29, 2015 14:23
ESP8266_Shield_Nano_gravitech
/*Example CMMC ESP8266*/
#include "Wire.h" // enable I2C bus
byte saa1064 = 0x70 >> 1; // define the I2C bus address for our SAA1064 (pin 1 to GND)
int digits[17] = {
63, 6, 91, 79, 102, 109, 125, 7, 127, 111, 119, 124, 57, 94, 121, 113, 0
};
// these are the byte representations of pins required to display each digit 0~9 then A~F, and blank digit
int sensorPin = A0;
int sensorValue = 0;
##############################################################
nodemcuv2.name=NodeMCUV2 (ESP8266 ESP-12E Module)
nodemcuv2.upload.tool=esptool
nodemcuv2.upload.speed=115200
nodemcuv2.upload.resetmethod=ck
nodemcuv2.upload.maximum_size=4194304
nodemcuv2.upload.wait_for_upload_port=true
nodemcuv2.serial.disableDTR=true
nodemcuv2.serial.disableRTS=true
// SIMPLE PWM WITH ESP8266 & ARDUINO IDE
// USE Ticker class instead of delay() function
//
#include <Ticker.h>
#define SCALER 20
Ticker flipper;
int count = 0;
/*Button*/
// set pin numbers:
const int buttonPin = 16; // the number of the pushbutton pin
const int ledPin = 1; // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
/*
Analog input, analog output, serial output
*/
// These constants won't change. They're used to give names
// to the pins used:
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to
int sensorValue = 0; // value read from the pot
/*
RGB Fading
*/
#include <EEPROM.h>
const int maxdelay = 99;
const int maxmode = 4;
const int redpin = 16; // LED connected to digital pin 11
const int bluepin = 14; // LED connected to digital pin 10
const int greenpin = 12; // LED connected to digital pin 9
#include <ESPert.h>
#include <ESP8266WiFi.h>
#include "CMMCInterval.h"
void CurrentPrint();
CMMCInterval myInterval1(1, CurrentPrint);
float out = 0;
double sum = 0;
#include <ESPert.h>
#include <ESP8266WiFi.h>
#include "CMMCInterval.h"
void CurrentPrint();
CMMCInterval myInterval1(1, CurrentPrint);
float out = 0;
double sum = 0;