Skip to content

Instantly share code, notes, and snippets.

byte inbuff[255];
byte outbuff[255];
#define rate 115200
void setup() {
Serial.begin(rate);
while (!Serial) ;
Serial1.begin(rate);
while (!Serial1);
@volca
volca / test_wifi.ino
Last active March 24, 2016 15:29
Test wifi for cactus micro
#include <SoftwareSerial.h>
// Important!! We use pin 13 for enable esp8266
#define WIFI_ENABLE_PIN 13
#define DEBUG 1
#define SSID "YOUR-WIFI-SSID"
#define PASS "YOUR-WIFI-SECRET"
/* YourDuino.com Example Software Sketch
DHT11 Humidity and Temperature Sensor test
Credits: Rob Tillaart
http://arduino-direct.com/sunshop/index.php?l=product_detail&p=162
terry@yourduino.com */
/*-----( Import needed libraries )-----*/
#include <dht11.h>
/*-----( Declare objects )-----*/
@volca
volca / crc16.c
Created September 24, 2015 10:09
crc16
static uint16 crc16(uint16 crc, uint8 val) {
const uint16 poly = 0x1021;
uint8 cnt;
for (cnt = 0; cnt < 8; cnt++, val <<= 1)
{
uint8 msb = (crc & 0x8000) ? 1 : 0;
crc <<= 1;
@volca
volca / osx-bandaid.sh
Created October 11, 2015 02:29
script for build esp-open-sdk under OS X 10.11, see https://github.com/pfalcon/esp-open-sdk/issues/94
#!/usr/bin/env bash
gsed -i '1s/^/#include <stddef.h>\n/' crosstool-NG/.build/src/gcc-4.8.2/gcc/graphite.c
gsed -i '1s/^/#include <stddef.h>\n/' crosstool-NG/.build/src/gcc-4.8.2/gcc/graphite-blocking.c
gsed -i '1s/^/#include <stddef.h>\n/' crosstool-NG/.build/src/gcc-4.8.2/gcc/graphite-clast-to-gimple.c
gsed -i '1s/^/#include <stddef.h>\n/' crosstool-NG/.build/src/gcc-4.8.2/gcc/graphite-dependences.c
gsed -i '1s/^/#include <stddef.h>\n/' crosstool-NG/.build/src/gcc-4.8.2/gcc/graphite-interchange.c
gsed -i '1s/^/#include <stddef.h>\n/' crosstool-NG/.build/src/gcc-4.8.2/gcc/graphite-optimize-isl.c
gsed -i '1s/^/#include <stddef.h>\n/' crosstool-NG/.build/src/gcc-4.8.2/gcc/graphite-poly.c
gsed -i '1s/^/#include <stddef.h>\n/' crosstool-NG/.build/src/gcc-4.8.2/gcc/graphite-scop-detection.c
gsed -i '1s/^/#include <stddef.h>\n/' crosstool-NG/.build/src/gcc-4.8.2/gcc/graphite-sese-to-poly.c
#include <Arduino.h>
#define MY_DEBUG
#define MY_BAUD_RATE 9600
// Mode Radio / Enable and select radio type attached
#define MY_RADIO_NRF5_ESB
#define MY_NRF5_ESB_PA_LEVEL NRF5_PA_MAX
#define MY_NODE_ID 6
#include "MySensors.h"
#include <Wire.h>