Skip to content

Instantly share code, notes, and snippets.

@crcastle
crcastle / temp-humidity-sensor.ino
Created October 19, 2015 21:43
Temperature and Humidity Sensor Code (sensebender micro, nrf24l01+)
#include <Wire.h>
#include <SI7021.h>
#include <SPI.h>
#include <RF24Network.h> // library from http://tmrh20.github.io/RF24Network
#include <RF24.h> // library from http://tmrh20.github.io/RF24/
#include "LowPower.h" // library from https://github.com/rocketscream/Low-Power
#define LED_PIN A2
RF24 radio(9, 10); // Set up nRF24L01 radio on SPI bus plus pins 9 & 10
@crcastle
crcastle / temp-sensor.ino
Created October 19, 2015 21:38
Temperature Sensor Code (atmega328p, nrf24l01+, and ds18b20)
#include <SPI.h>
#include <RF24Network.h> // library from http://tmrh20.github.io/RF24/
#include <RF24.h> // library from http://tmrh20.github.io/RF24Network
#include <OneWire.h>
#include <DallasTemperature.h>
#include "LowPower.h" // library from https://github.com/rocketscream/Low-Power
#define POWER 9 //power pin to reduce consumption while sleeping
RF24 radio(7, 8); // Set up nRF24L01 radio on SPI bus plus pins 7 & 8
@crcastle
crcastle / ESP8266-nRF24L01.ino
Created September 23, 2015 06:38
Using an Adafruit Huzzah ESP8266 with nRF24L01+ as a (one-way) internet gateway for several nRF24L01+ sensor nodes
#include <SPI.h>
#include <RF24Network.h>
#include <RF24.h>
#include <ESP8266WiFi.h>
const char* ssid = "ssid";
const char* password = "password";
const char* host = "coolapp.herokuapp.com";
#!/bin/bash
brew_command=/usr/local/bin/brew
brew_cask_command="$brew_command cask"
echo '#!/bin/bash'
echo ''
echo 'trap ctrl_c INT'
echo 'function ctrl_c() {'
echo 'echo "** Trapped CTRL-C"'
@crcastle
crcastle / ESP8266 Code (RX node)
Created July 13, 2015 01:14
Resolution of issue with ESP8266 described in https://gist.github.com/crcastle/93ebe3b42f3ab021639b (see comments for detailed changes)
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#define DEVICE_ID 2
#define CHANNEL 1 //MAX 127
// SPI pin configuration figured out from here:
// http://d.av.id.au/blog/esp8266-hardware-spi-hspi-general-info-and-pinout/
RF24 radio(2, 15); // Set up nRF24L01 radio on SPI bus plus pins 2 for CE and 15 for CSN
@crcastle
crcastle / ESP8266 Code (RX node)
Last active December 15, 2022 23:36
Trying to use NRF24L01+ on ESP8266, using the ESP8266 as MCU (i.e. not an Arduino or ATmega328). See https://github.com/esp8266/Arduino for details on initial setup of ESP8266 as Arduino-compatible MCU. The serial output below does not show expected messages: a) the full output shows up all at once then stops dead and b) the values for _salt, vo…
#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 };
Remove osxfuse if installed via homebrew:
> brew uninstall osxfuse
Install osxfuse binary and choose to install the MacFUSE compatibility layer:
http://sourceforge.net/projects/osxfuse/files/latest/download?source=files
Reboot (optional but recommended by osxfuse)
Install ntfs-3g via homebrew:
> brew update && brew install ntfs-3g

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

#!/usr/bin/ruby
# Requirements:
# - rb-dayone and doing gems installed for the system Ruby.
# (Mine (OSX 10.10) are in /Library/Ruby/Gems/2.0.0/gems/)
#
# How to run:
# $./dayone-to-doing.rb 0A8BE4BB9F7E40B5A6F3F621797FC6F5.doentry
# The parameter passed to the script is the doentry file that was just created.
# The script will:
worker_processes 4;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;