Skip to content

Instantly share code, notes, and snippets.

View gonAlonso's full-sized avatar

Gonzalo Alonso gonAlonso

View GitHub Profile
@gonAlonso
gonAlonso / Arduino code
Created July 19, 2015 16:15
Rf24 test code for Arduino
/*
// March 2014 - TMRh20 - Updated along with High Speed RF24 Library fork
// Parts derived from examples by J. Coliz <maniacbug@ymail.com>
*/
/**
* Example for efficient call-response using ack-payloads
*
* This example continues to make use of all the normal functionality of the radios including
* the auto-ack and auto-retry features, but allows ack-payloads to be written optionlly as well.
* This allows very fast call-response communication, with the responding radio never having to
// see https://gist.github.com/natevw/5789019 for pins
var NRF24 = require("./index"),
spiDev = "/dev/spidev0.0",
cePin = 24, irqPin = 25, //var ce = require("./gpio").connect(cePin)
pipes = [0xF0F0F0F0E1, 0xF0F0F0F0D2],
role = 'pong'; // ping or pong
var stream = require('stream'),
util = require('util');