Skip to content

python-lib for interfacing with nRF24L01 modules

Notifications You must be signed in to change notification settings

jojolian753/python-nrf24

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

python-nrf24

python-lib for interfacing with nRF24L01 modules

Introduction

The library is to be used with python2.

Requirements

Wiring

   nRF24L01              RaspberryPi
+-+-+                    (header)      wiringpi-pins
|8|7|	1: GND      ->   6              -
+-+-+	2: 3.3V     ->   1              -
|6|5|	3: CE       ->   13             2
+-+-+	4: CSN      ->   15             3
|4|3|	5: SCKL     ->   23            14
+-+-+	6: MOSI     ->   19            12
|2|1|	7: MISO     ->   21            13
+-+-+	8: IRQ      ->   not used      not used

Example

For a sender:

from nrf24 import Nrf24
nrf = Nrf24(cePin=2,csnPin=3,channel=10,payload=8)
nrf.config()
nrf.setRADDR("host1")
nrf.setTADDR("host2")

if not nrf.isSending():
	nrf.send(map(ord,"Hello"))

For a receiver:

from nrf24 import Nrf24
nrf = Nrf24(cePin=2,csnPin=3,channel=10,payload=8)
nrf.config()
nrf.setRADDR("host2")
nrf.setTADDR("host1")

while True:
	if nrf.dataReady():
		print nrf.getData()
		break

About

python-lib for interfacing with nRF24L01 modules

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published