Commit 63b672c9 authored by TMRh20's avatar TMRh20

Add RPi B+ info to main examples and readme

parent 5ff3088e
...@@ -1077,6 +1077,12 @@ private: ...@@ -1077,6 +1077,12 @@ private:
* This is an example of how to use the RF24 class to communicate with ATtiny85 and other node. <br> * This is an example of how to use the RF24 class to communicate with ATtiny85 and other node. <br>
*/ */
/**
* @example timingSearch3pin.ino
* <b>New: Contributed by https://github.com/tong67</b><br>
* This is an example of how to determine the correct timing for ATtiny when using only 3-pins
*/
/** /**
* @example pingpair_dyn.ino * @example pingpair_dyn.ino
* *
...@@ -1178,12 +1184,11 @@ private: ...@@ -1178,12 +1184,11 @@ private:
* - Mega Boards (1280, 2560, etc) * - Mega Boards (1280, 2560, etc)
* - Arduino Due: Must use one of the hardware SS/CSN pins as extended SPI methods are used. * - Arduino Due: Must use one of the hardware SS/CSN pins as extended SPI methods are used.
* Initial Due support taken from https://github.com/mcrosson/RF24/tree/due * Initial Due support taken from https://github.com/mcrosson/RF24/tree/due
* - ATTiny board support added from https://github.com/jscrane/RF24 * - ATTiny board support initially added from https://github.com/jscrane/RF24
* Note: ATTiny support is built into the library. Do not include SPI.h. <br> * Note: ATTiny support is built into the library. Do not include SPI.h. <br>
* ATTiny 85: D0(pin 5): MISO, D1(pin6) MOSI, D2(pin7) SCK, D3(pin2):CSN/SS, D4(pin3): CE <br> * See the included examples for more info on using ATTiny with RF24 <br>
* ATTiny 84: PA6:MISO, PA5:MOSI, PA4:SCK, PA7:CSN/SS, CE as desired <br>
* See https://github.com/TCWORLD/ATTinyCore/tree/master/PCREL%20Patch%20for%20GCC for ATTiny patch * See https://github.com/TCWORLD/ATTinyCore/tree/master/PCREL%20Patch%20for%20GCC for ATTiny patch
* - Raspberry Pi Support: See the readme at https://github.com/TMRh20/RF24/tree/master/RPi * - Raspberry Pi Support: See the readme at https://github.com/TMRh20/RF24/tree/master/RPi/RF24
* *
* @section More More Information * @section More More Information
* *
......
...@@ -38,6 +38,9 @@ using namespace std; ...@@ -38,6 +38,9 @@ using namespace std;
// Setup for GPIO 22 CE and CE0 CSN with SPI Speed @ 4Mhz // Setup for GPIO 22 CE and CE0 CSN with SPI Speed @ 4Mhz
//RF24 radio(RPI_V2_GPIO_P1_15, BCM2835_SPI_CS0, BCM2835_SPI_SPEED_4MHZ); //RF24 radio(RPI_V2_GPIO_P1_15, BCM2835_SPI_CS0, BCM2835_SPI_SPEED_4MHZ);
// NEW: Setup for RPi B+
//RF24 radio(RPI_BPLUS_GPIO_J8_15,RPI_BPLUS_GPIO_J8_24, BCM2835_SPI_SPEED_8MHZ);
// Setup for GPIO 22 CE and CE0 CSN with SPI Speed @ 8Mhz // Setup for GPIO 22 CE and CE0 CSN with SPI Speed @ 8Mhz
RF24 radio(RPI_V2_GPIO_P1_15, RPI_V2_GPIO_P1_24, BCM2835_SPI_SPEED_8MHZ); RF24 radio(RPI_V2_GPIO_P1_15, RPI_V2_GPIO_P1_24, BCM2835_SPI_SPEED_8MHZ);
...@@ -163,8 +166,9 @@ int main(int argc, char** argv){ ...@@ -163,8 +166,9 @@ int main(int argc, char** argv){
// Fetch the payload, and see if this was the last one. // Fetch the payload, and see if this was the last one.
radio.read( &got_time, sizeof(unsigned long) ); while(radio.available()){
radio.read( &got_time, sizeof(unsigned long) );
}
radio.stopListening(); radio.stopListening();
radio.write( &got_time, sizeof(unsigned long) ); radio.write( &got_time, sizeof(unsigned long) );
......
...@@ -33,6 +33,9 @@ using namespace std; ...@@ -33,6 +33,9 @@ using namespace std;
// Setup for GPIO 15 CE and CE0 CSN with SPI Speed @ 4Mhz // Setup for GPIO 15 CE and CE0 CSN with SPI Speed @ 4Mhz
//RF24 radio(RPI_V2_GPIO_P1_15, BCM2835_SPI_CS0, BCM2835_SPI_SPEED_4MHZ); //RF24 radio(RPI_V2_GPIO_P1_15, BCM2835_SPI_CS0, BCM2835_SPI_SPEED_4MHZ);
// NEW: Setup for RPi B+
//RF24 radio(RPI_BPLUS_GPIO_J8_15,RPI_BPLUS_GPIO_J8_24, BCM2835_SPI_SPEED_8MHZ);
// Setup for GPIO 15 CE and CE0 CSN with SPI Speed @ 8Mhz // Setup for GPIO 15 CE and CE0 CSN with SPI Speed @ 8Mhz
RF24 radio(RPI_V2_GPIO_P1_15, RPI_V2_GPIO_P1_24, BCM2835_SPI_SPEED_8MHZ); RF24 radio(RPI_V2_GPIO_P1_15, RPI_V2_GPIO_P1_24, BCM2835_SPI_SPEED_8MHZ);
......
...@@ -28,6 +28,9 @@ using namespace std; ...@@ -28,6 +28,9 @@ using namespace std;
// Setup for GPIO 22 CE and CE0 CSN with SPI Speed @ 4Mhz // Setup for GPIO 22 CE and CE0 CSN with SPI Speed @ 4Mhz
//RF24 radio(RPI_V2_GPIO_P1_15, BCM2835_SPI_CS0, BCM2835_SPI_SPEED_4MHZ); //RF24 radio(RPI_V2_GPIO_P1_15, BCM2835_SPI_CS0, BCM2835_SPI_SPEED_4MHZ);
// NEW: Setup for RPi B+
//RF24 radio(RPI_BPLUS_GPIO_J8_15,RPI_BPLUS_GPIO_J8_24, BCM2835_SPI_SPEED_8MHZ);
// Setup for GPIO 22 CE and CE0 CSN with SPI Speed @ 8Mhz // Setup for GPIO 22 CE and CE0 CSN with SPI Speed @ 8Mhz
RF24 radio(RPI_V2_GPIO_P1_15, RPI_V2_GPIO_P1_24, BCM2835_SPI_SPEED_8MHZ); RF24 radio(RPI_V2_GPIO_P1_15, RPI_V2_GPIO_P1_24, BCM2835_SPI_SPEED_8MHZ);
......
...@@ -32,6 +32,9 @@ using namespace std; ...@@ -32,6 +32,9 @@ using namespace std;
// Setup for GPIO 22 CE and CE0 CSN with SPI Speed @ 4Mhz // Setup for GPIO 22 CE and CE0 CSN with SPI Speed @ 4Mhz
//RF24 radio(RPI_V2_GPIO_P1_15, BCM2835_SPI_CS0, BCM2835_SPI_SPEED_4MHZ); //RF24 radio(RPI_V2_GPIO_P1_15, BCM2835_SPI_CS0, BCM2835_SPI_SPEED_4MHZ);
// NEW: Setup for RPi B+
//RF24 radio(RPI_BPLUS_GPIO_J8_15,RPI_BPLUS_GPIO_J8_24, BCM2835_SPI_SPEED_8MHZ);
// Setup for GPIO 22 CE and CE0 CSN with SPI Speed @ 8Mhz // Setup for GPIO 22 CE and CE0 CSN with SPI Speed @ 8Mhz
RF24 radio(RPI_V2_GPIO_P1_15, RPI_V2_GPIO_P1_24, BCM2835_SPI_SPEED_8MHZ); RF24 radio(RPI_V2_GPIO_P1_15, RPI_V2_GPIO_P1_24, BCM2835_SPI_SPEED_8MHZ);
......
...@@ -81,6 +81,11 @@ Choose any RPi output pin for radio CE pin. ...@@ -81,6 +81,11 @@ Choose any RPi output pin for radio CE pin.
RF24 radio(RPI_V2_GPIO_P1_15,BCM2835_SPI_CS0, BCM2835_SPI_SPEED_8MHZ); RF24 radio(RPI_V2_GPIO_P1_15,BCM2835_SPI_CS0, BCM2835_SPI_SPEED_8MHZ);
or or
RF24 radio(RPI_V2_GPIO_P1_15,BCM2835_SPI_CS1, BCM2835_SPI_SPEED_8MHZ); RF24 radio(RPI_V2_GPIO_P1_15,BCM2835_SPI_CS1, BCM2835_SPI_SPEED_8MHZ);
RPi B+:
RF24 radio(RPI_BPLUS_GPIO_J8_15,RPI_BPLUS_GPIO_J8_24, BCM2835_SPI_SPEED_8MHZ);
or
RF24 radio(RPI_BPLUS_GPIO_J8_15,RPI_BPLUS_GPIO_J8_26, BCM2835_SPI_SPEED_8MHZ);
**Pins:** **Pins:**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment