A fortnight ago I purchased two shields from Embedded Coolness for a couple of nRF24L01 based projects (quadcopter & robot control system) I’m working on.The shields were very reasonably priced and took roughly 10-15 minutes each to assemble.
Though intended for Arduino based projects the hardware SPI port works with the Nordic nRF24L01 .Net Micro Framework Driver on Codeplex.
I adapted the sample application included with the Nordic nRF24L01 .Net Micro Framework Driver source from codeplex to give a minimal working Netduino example.
...
public class EmbeddCoolnessTestHarness
{
private const byte channel = 10;
private readonly OutputPort _led = new OutputPort(Pins.ONBOARD_LED, false);
private readonly NRF24L01Plus _module;
private Timer _timer;
private byte _token;
private readonly byte[] _myAddress = Encoding.UTF8.GetBytes("NetP1");
private readonly byte[] _otherBoard = Encoding.UTF8.GetBytes("NetP2");
public EmbeddCoolnessTestHarness()
{
_module = new NRF24L01Plus();
}
public void Run()
{
_module.OnDataReceived += OnReceive;
_module.OnTransmitFailed += OnSendFailure;
_module.OnTransmitSuccess += OnSendSuccess;
// we need to call Initialize() and Configure() before we start using the module
_module.Initialize(SPI.SPI_module.SPI1, Pins.GPIO_PIN_D7, Pins.GPIO_PIN_D3, Pins.GPIO_PIN_D2);
_module.Configure(_myAddress, channel);
_module.Enable();
_timer = new Timer(SendMessage, null, new TimeSpan(0, 0, 0, 1), new TimeSpan(0, 0, 0, 1));
}
private void OnSendSuccess()
{
_led.Write(false);
}
private void OnSendFailure()
{
Debug.Print("Send failed!");
}
private void OnReceive(byte[] data)
{
Debug.Print("Token = " + data[0]);
}
private void SendMessage(object state)
{
_led.Write(true);
_module.SendTo(_otherBoard, new[] { _token });
_token++;
}
}
Pingback: Netduino Plus and nRF24L01 module shield | Ardu...
Pingback: Electric Vehicle Camp 2014-06 | devMobile's blog
Pingback: .Net Meadow nRF24L01 library Part1 | devMobile's blog
Pingback: TinyCLR OS V2 nRF24L01 library Part1 | devMobile's blog
Pingback: nanoFramework nRF24L01 library Part1 | devMobile's blog