Skip to content

Instantly share code, notes, and snippets.

Avatar

volca volca

View GitHub Profile
View MySensors.ino
#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 Oct 11, 2015
script for build esp-open-sdk under OS X 10.11, see https://github.com/pfalcon/esp-open-sdk/issues/94
View osx-bandaid.sh
#!/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
View crc16.c
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;
View bleLogger.ino
/* 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 Mar 24, 2016
Test wifi for cactus micro
View test_wifi.ino
#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"
View ble_upgrade.ino
byte inbuff[255];
byte outbuff[255];
#define rate 115200
void setup() {
Serial.begin(rate);
while (!Serial) ;
Serial1.begin(rate);
while (!Serial1);
View sniffer_test.ino
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!");
View rc-local.service
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
View blink.ino
View post-update
#!/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.
You can’t perform that action at this time.