Skip to content

Instantly share code, notes, and snippets.

#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>
@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
@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;
/* 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 / 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"
byte inbuff[255];
byte outbuff[255];
#define rate 115200
void setup() {
Serial.begin(rate);
while (!Serial) ;
Serial1.begin(rate);
while (!Serial1);
String tmp;
void setup() {
Serial.begin(115200);
Serial1.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
Serial.println("hello!");
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
@volca
volca / post-update
Last active November 6, 2018 09:07
Please see the link: http://www.ooso.net/archives/596
#!/bin/sh
#
# This hook does two things:
#
# 1. update the "info" files that allow the list of references to be
# queries over dumb transports such as http
#
# 2. if this repository looks like it is a non-bare repository, and
# the checked-out branch is pushed to, then update the working copy.
# This makes "push" function somewhat similarly to darcs and bzr.