NRFLITE LIBRARY

when using NRFLITE LIBRARY of dparson my LED that blinks is very DIM using Arduino R3 /pro mini hardware.

I tested same program with RF24 library on those hardware and the led blink program is bright as should be.

could it be anything to do with the library itself?

#include <SPI.h>
 #include <NRFLite.h>

const static uint8_t RADIO_ID = 0; // Our radio's id. The transmitter will send to this id.
 const static uint8_t PIN_RADIO_CE = 9;
 const static uint8_t PIN_RADIO_CSN = 10;

const uint8_t LED[] = {2, 3, 4};
 uint8_t myArray[1];

struct RadioPacket // Any packet up to 32 bytes can be sent.
 {
 uint8_t FromRadioId;
 uint32_t OnTimeMillis;
 uint32_t FailedTxCount;
 };

NRFLite _radio(Serial);
 RadioPacket _radioData;

void setup()
 {
 Serial.begin(115200);

if (!_radio.init(RADIO_ID, PIN_RADIO_CE, PIN_RADIO_CSN, NRFLite::BITRATE250KBPS, 50))
 {
 Serial.println("Cannot communicate with radio");
 while (1); // Wait here forever.
 }
 _radio.printDetails();

/*
 By default, 'init' configures the radio to use a 2MBPS bitrate on channel 100 (channels 0-125 are valid).
 Both the RX and TX radios must have the same bitrate and channel to communicate with each other.
 You can assign a different bitrate and channel as shown below.
 _radio.init(RADIO_ID, PIN_RADIO_CE, PIN_RADIO_CSN, NRFLite::BITRATE250KBPS, 0)
 _radio.init(RADIO_ID, PIN_RADIO_CE, PIN_RADIO_CSN, NRFLite::BITRATE1MBPS, 75)
 _radio.init(RADIO_ID, PIN_RADIO_CE, PIN_RADIO_CSN, NRFLite::BITRATE2MBPS, 100) // THE DEFAULT
 */
 }

void loop()
 {
 if (_radio.hasData())
 {
_radio.readData(&myArray); // Note how '&' must be placed in front of the variable name.
//Light up the correct LEDs
for (uint8_t j = 1; j <= 3; j++)
{
  if (myArray[0] == j) {
    digitalWrite(LED[j - 1], HIGH);
     Serial.println(j);
  }
  if (myArray[0] == 0) {
    digitalWrite(LED[j - 1], LOW);
    Serial.println("low");
  }
}


}
 }

Try moving the LED to a different pin.

You need to use pinMode() to set the LED pins to OUTPUT mode. The pins default to INPUT mode. When in INPUT mode, digitalWrite(pin, HIGH) turns the internal pull-up resistor on and digitalWrite(pin, LOW) turns it off. So the internal pull-up resistor is acting as a very high value current limiting resistor on the LED, thus the dimness.

pert:
You need to use pinMode() to set the LED pins to OUTPUT mode. The pins default to INPUT mode. When in INPUT mode, digitalWrite(pin, HIGH) turns the internal pull-up resistor on and digitalWrite(pin, LOW) turns it off. So the internal pull-up resistor is acting as a very high value current limiting resistor on the LED, thus the dimness.

oops you right , must have been when i copy pasted :), forgot the setup part. thanks, was driving me nuts.

You're welcome. I'm glad if I was able to be of assistance. Enjoy!
Per