Skip to content

Instantly share code, notes, and snippets.

@shnae
shnae / fuelTankReaderWithNrf24L01Receiver
Created March 10, 2014 01:07
This is the corresponding sketch to the fuelTankReaderWithNrf24L01 sketch. It publishes a web page with mixed text/xml data for use with deviceLogger. Important: this will only work with SOFT spi, you can see instructions for that on www.shanes.net
#include <SPI.h>
#include <Dhcp.h>
#include <Dns.h>
#include <Ethernet.h>
#include <EthernetClient.h>
#include <EthernetServer.h>
#include <EthernetUdp.h>
#include <DigitalIO.h>
#include <DigitalPin.h>
#include <I2cConstants.h>
@shnae
shnae / fuelTankReaderWithNrf24L01
Created March 10, 2014 01:02
Arduino sketch that takes a measurement from an ultrasonic sensor and transmits it over nrf24l01 to a receiving unit
#include <RunningMedian.h>
#include <LowPower.h>
#include <nRF24L01.h>
#include <SPI.h>
#include <RF24.h>
#include <RF24_config.h>
#include <NewPing.h>
#include <math.h>
#define triggerPin 5
#define echoPin 6
@shnae
shnae / rf24SoftSPI_withEthernetShield_test
Last active August 29, 2015 13:55
companion sketch to the send basic string sketch, for use with Ethernet shield and nrf24l01 simultaneously
#include <SPI.h>
#include <Dhcp.h>
#include <Dns.h>
#include <Ethernet.h>
#include <EthernetClient.h>
#include <EthernetServer.h>
#include <EthernetUdp.h>
#include <DigitalIO.h>
@shnae
shnae / receive_string_withChecksum
Created January 27, 2014 04:01
The receive string sketch plus a 'checksum' function
#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>
#include <SPI.h>
/*
This sketch receives strings from sending unit via nrf24
and prints them out via serial. The sketch waits until
it receives a specific value (2 in this case), then it
prints the complete message and clears the message buffer.
@shnae
shnae / nrf24l01_send_string
Created January 27, 2014 03:36
Arduino sketch showing a very basic method of sending a string
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>
/*
This sketch sends a string to a corresponding Arduino
with nrf24 attached. It appends a specific value
(2 in this case) to the end to signify the end of the
message.
@shnae
shnae / nrf24l01_receive_string
Last active January 28, 2017 20:00
Arduino sketch showing a very simple way to receive a string using nrf24l01 radios.
#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>
#include <SPI.h>
/*
This sketch receives strings from sending unit via nrf24
and prints them out via serial. The sketch waits until
it receives a specific value (2 in this case), then it
prints the complete message and clears the message buffer.
@shnae
shnae / nrf24l01_basicReceive
Last active April 8, 2016 12:58
nrf24l01_basicReceive
#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>
#include <SPI.h>
/*
This is the corresponding sketch to the 'basicSend' sketch.
the nrf24l01 will listen for numbers 0-255, and light the red LED
whenever a number in the sequence is missed. Otherwise,
it lights the green LED
*/
@shnae
shnae / nrf24l01_basicSend
Created January 10, 2014 05:05
A very basic send test for Arduino with nrf24l01
#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>
#include <SPI.h>
int msg[1];
RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL;
/*
this is the most basic sketch I can think of to transmit data from an nrf24l01.
It loops over the numbers 0-255 continuously and sends each number to the receiving
@shnae
shnae / ultrasonic_GarageParkAssist
Created January 4, 2014 17:48
Ultrasonic Garage Parking Assist
#include <NewPing.h>
#include <EEPROM.h>
#define redLed 11
#define yellowLed 10
#define greenLed 9
#define triggerPin 2
#define echoPin 3
#define buttonPin 12
/*