This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################## | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SIMPLE PWM WITH ESP8266 & ARDUINO IDE | |
// USE Ticker class instead of delay() function | |
// | |
#include <Ticker.h> | |
#define SCALER 20 | |
Ticker flipper; | |
int count = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Blink*/ | |
void setup() { | |
// initialize digital pin 13 as an output. | |
pinMode(1, OUTPUT); | |
} | |
// the loop function runs over and over again forever | |
void loop() { | |
digitalWrite(1, HIGH); // turn the LED on (HIGH is the voltage level) | |
delay(1000); // wait for a second |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESPert.h> | |
#include <ESP8266WiFi.h> | |
#include "CMMCInterval.h" | |
void CurrentPrint(); | |
CMMCInterval myInterval1(1, CurrentPrint); | |
float out = 0; | |
double sum = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESPert.h> | |
#include <ESP8266WiFi.h> | |
#include "CMMCInterval.h" | |
void CurrentPrint(); | |
CMMCInterval myInterval1(1, CurrentPrint); | |
float out = 0; | |
double sum = 0; |
OlderNewer