Example #1
0
 private static void InitializeRadio()
 {
     _radio = new NRF24L01Plus();
     _radio.Initialize(Spi, ChipSelectPin, ChipEnablePin, InterruptPin);
     _radio.Configure(Encoding.UTF8.GetBytes(Address), Channel);
     _radio.Enable();
 }
Example #2
0
 private static void InitializeRadio()
 {
     Debug.Print("Initializing radio...");
     _radio = new NRF24L01Plus();
     _radio.Initialize(Spi, ChipSelectPin, ChipEnablePin, InterruptPin);
     _radio.Configure(Encoding.UTF8.GetBytes(Address), Channel);
     _radio.OnDataReceived += data => _bootloader.Process(data);
     _radio.Enable();
 }
Example #3
0
        /// <summary>
        /// Gadgeteer Nordic NRF24L01+ module.
        /// </summary>
        /// <param name="socketNumber">The socket that this module is plugged in to.</param>
        public Nordic(int socketNumber)
        {
            var socket = Socket.GetSocket(socketNumber, true, this, null);

            Api = new NRF24L01Plus();
            Api.Initialize(socket.SPIModule, socket.CpuPins[6], socket.CpuPins[4], socket.CpuPins[3]);
            Api.OnDataReceived    += OnDataReceived;
            Api.OnTransmitFailed  += OnTransmitFailed;
            Api.OnTransmitSuccess += OnTransmitSuccess;
        }
        static void Main(string[] args)
        {
            SPI           SPIport = new Microsoft.SPOT.Hardware.SPI(new Microsoft.SPOT.Hardware.SPI.Configuration(Cpu.Pin.GPIO_NONE, false, 0, 0, false, true, 2000, SPI.SPI_module.SPI1));
            OutputPort    nCE     = new OutputPort(Cpu.Pin.GPIO_Pin2, true);
            InterruptPort nINT    = new InterruptPort(Cpu.Pin.GPIO_Pin4, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);

            NRF24L01Plus n = new NRF24L01Plus();

            n.Initialize(SPIport, nCE, nINT);

            byte[] address = n.GetAddress(AddressSlot.Zero, 5);
            Console.WriteLine("First Address: " + ByteArrayToHexString(address));

            byte[] b = new byte[] { 0x04, 0x09, 0x02, 0x03, 0x04 };
            n.SetAddress(AddressSlot.Zero, b, false);

            address = n.GetAddress(AddressSlot.Zero, 5);
            Console.WriteLine("Second Address: " + ByteArrayToHexString(address));

            nCE.Dispose();
            nINT.Dispose();
        }
Example #5
0
 public Program()
 {
     _radio = new NRF24L01Plus();
 }
 public Client()
 {
     radio = new NRF24L01Plus();
 }