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
https://github.com/esp8266/Arduino/blob/342c4ae6fb847bfc787f80b89a2bb888d942dc32/libraries/ESP8266WiFi/src/include/UdpContext.h#L308 | |
private: | |
void _reserve(size_t size) | |
{ | |
const size_t pbuf_unit_size = 512; | |
if (!_tx_buf_head) | |
{ | |
_tx_buf_head = pbuf_alloc(PBUF_TRANSPORT, pbuf_unit_size, PBUF_RAM); |
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
function video-upload() { | |
if [ $# -lt 1 ]; then | |
echo "[ERROR] Missing required file name." | |
else | |
FILESIZE=$(wc -c "$1" | awk '{print $1}') | |
printf "[START] Uploading $FILESIZE bytes.\n" | |
MEDIAID=$(twurl /1.1/media/upload.json -H upload.twitter.com -d "command=INIT&media_category=amplify_video&media_type=video/mp4&total_bytes=$FILESIZE" | jq .media_id_string | sed 's/\"//g') | |
INDEX=0 | |
split -b 5m $1 twitter-video- |
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
// File: WiWi_FTP_Client.ino for ESP8266 NodeMCU | |
/* | |
Original Arduino: FTP passive client | |
http://playground.arduino.cc/Code/FTP | |
Modified 6 June 2015 by SurferTim | |
You can pass flash-memory based strings to Serial.print() by wrapping them with F(). | |
2015-12-09 Rudolf Reuter, adapted to ESP8266 NodeMCU, with the help of Markus. | |
*/ |
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
struct spiffs_helper_t { | |
File f; | |
spiffs_helper_t(const char * _path ) { | |
f = SPIFFS.open(_path, "r+"); // try to open if there... for read and write | |
if (!f) { | |
f = SPIFFS.open(_path, "w+"); // if fail open for read/write but new | |
} | |
}; |
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
#define TRIAC_PIN 5 | |
#define ZERO_CROSS_PIN 4 | |
#define DEBOUNCE_TIME 9000 //9ms - 10ms is the pulse period | |
static uint32_t lastPulse = 0; | |
static uint16_t period = 5000; //5ms - 50% for each half wave | |
void ICACHE_RAM_ATTR onTimerISR(){ | |
if(GPIP(TRIAC_PIN)){//OUTPUT is HIGH | |
GPOC = (1 << TRIAC_PIN);//low |
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
// from https://raw.githubusercontent.com/royi1000/ardu-info-center/63df56531a5368c9d195c5effe2d307da26e21a6/gateway/gateway.ino | |
#include <avr/pgmspace.h> | |
#include <avr/eeprom.h> | |
#include <Wire.h> | |
#include <SPI.h> | |
#include <EEPROM.h> | |
#include <DS1307RTC.h> | |
#include <Time.h> | |
#include <Ethernet.h> | |
#include <EthernetUdp.h> |
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
// CPU 80MHZ, FLASH 4M/1M | |
/* | |
*** Sample using esp-01, D16 is connected to RST | |
*** If DHT22 is powered by a gpio( VCC of DHT22 is connected to a gpio) and OUTPUT of DHT22 is connected to D2, boot will fail. | |
*** Power off ----> D2 is in LOW( == DHT22 is in LOW) ==> SDIO boot mode. | |
Temperature and humidity values are each read out the results of the last measurement. | |
For real-time data that need continuous read twice, we recommend repeatedly to read sensors, | |
and each read sensor interval is greater than 2 seconds to obtain accuratethe data. |
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 <ESP8266WiFi.h> | |
#include <WiFiUdp.h> | |
#include "PietteTech_DHT.h" | |
// ap setting | |
#include "/usr/local/src/ap_setting.h" | |
extern "C" { | |
#include "user_interface.h" | |
} |
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 <SPI.h> | |
#include <nRF24L01.h> | |
#include <RF24.h> | |
#define DEVICE_ID 2 | |
#define CHANNEL 1 //MAX 127 | |
RF24 radio(15, 15); // Set up nRF24L01 radio on SPI bus plus pins 7 & 8 | |
// Topology | |
const uint64_t pipes[2] = { 0xFFFFFFFFFFLL, 0xCCCCCCCCCCLL }; |
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
void requestEvent() | |
{ | |
if ( m % 2 == 0 ) { | |
I2C_writeAnything(sensor_data); | |
} else { | |
I2C_writeAnything(sensor_data_copy); | |
} | |
m++; | |
} |