NRF24L01 und Arduino Nano Problem


habe etwas komisches festgestellt, als ich den nrf24l01 einen arduino nano angeschlossen habe. sobald der ce pin vom nrf den pin 9 des nanos angeschlossen wird, dieser prompt nicht mehr senden, sobald man den jumper wieder rauszieht sendet er einwandfrei. nun frag ich mich woran das liegt, da dies ja sehr komisch ist. außerdem habe ich einen 10µf kondensator direkt nrf zwischen vin und gnd.

mein code:
sender:
code: [select]
/*-----( import needed libraries )-----*/
#include <spi.h>
#include <nrf24l01.h>
#include <rf24.h>

#include <dht.h>

dht dht;
#define dht11_pin 3

rf24 radio(9, 10);
int data[2];

void setup()   /****** setup: runs once ******/
{
  radio.begin();
  radio.setpalevel(rf24_pa_low);
  radio.setchannel(0x4c);

  // open pipe writing
  radio.openwritingpipe(0xf0f0f0f0e1ll);

  radio.enabledynamicpayloads();
  radio.setautoack(true);
  radio.powerup();

}//--(end setup )---


void loop()   /****** loop: runs ******/
{
  dht.read11(dht11_pin);
  data[0] = (int)dht.humidity;
  data[1] = (int)dht.temperature;
  radio.write( data, sizeof(data) );
 
  delay(5000);


}//--(end main loop )---

/*-----( declare user-written functions )-----*/

//none
//*********( end )***********


empfänger:

code: [select]
/*-----( import needed libraries )-----*/
#include <spi.h>
#include <nrf24l01.h>
#include <rf24.h>

#include <wire.h>
#include <liquidcrystal_i2c.h>

liquidcrystal_i2c lcd(0x27, 16, 2);

/*-----( declare constants , pin numbers )-----*/
#define ce_pin   9
#define csn_pin 53


/*-----( declare objects )-----*/
rf24 radio(ce_pin, csn_pin); // create radio
/*-----( declare variables )-----*/
int data[2];  // 2 element array holding joystick readings

void setup()   /****** setup: runs once ******/
{
  serial.begin(9600);
  lcd.begin();
  lcd.backlight();
  lcd.println("funk thermometer");
  radio.begin();
  radio.setpalevel(rf24_pa_low);
  radio.setchannel(0x4c);

  // open pipe reading
  radio.openreadingpipe(1,0xf0f0f0f0e1ll);

  radio.enabledynamicpayloads();
  radio.setautoack(true);
  radio.powerup();
  radio.startlistening();
  lcd.clear();
}//--(end setup )---


void loop()   /****** loop: runs ******/
{
  if ( radio.available() )
  {
    // read data payload until we've received everything
    bool done = false;
    while (!done)
    {
      // fetch data payload
      done = radio.read( data, sizeof(data) );
      serial.print(data[0]);
      serial.print("  ,  ");
      serial.println(data[1]);
      lcd.clear();
      lcd.print(data[0]);
      lcd.print("%, ");
      lcd.setcursor(0,1);
      lcd.print(data[1]);
      lcd.print((char)223);
      lcd.print("c");
    }
  }

}//--(end main loop )---

/*-----( declare user-written functions )-----*/

//none
//*********( end )***********



Arduino Forum > International > Deutsch (Moderator: uwefed) > NRF24L01 und Arduino Nano Problem


arduino

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code