Hi,
iam not able to get this thing working. Iam able to use ATtiny84 as a sender using folowing code.
#include <Arduino.h>
#define PC_PIN 2
int buttonPressed = 0;
#define SPI_CE_PIN 8
#define SPI_CSN_PIN 7
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(SPI_CE_PIN, SPI_CSN_PIN);
const byte address[6] = "00002";
void setup()
{
pinMode(PC_PIN, OUTPUT);
if (radio.begin())
{
digitalWrite(PC_PIN, HIGH);
delay(500);
digitalWrite(PC_PIN, LOW);
}
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MAX);
radio.setDataRate(RF24_250KBPS);
radio.stopListening();
}
void loop()
{
radio.write(&buttonPressed, sizeof(buttonPressed));
delay(1000);
}
But i have no idea why its not working as a receiver using this code
#include <Arduino.h>
#define PC_PIN 2
//#define POWER_SUPPLY_PIN 2
int buttonPressed = 0;
#define SPI_CE_PIN 8
#define SPI_CSN_PIN 7
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(SPI_CE_PIN, SPI_CSN_PIN);
const byte address[6] = "00002";
void setup()
{
pinMode(PC_PIN, OUTPUT);
while (!radio.begin())
{
}
radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MIN);
radio.setDataRate(RF24_250KBPS);
radio.startListening();
}
void loop()
{
if (radio.available())
{
digitalWrite(PC_PIN, HIGH);
}
}
Iam using separate Uno as a receiver to confirm that iam sending and there is no problem. Why my nRF24L01 doesnt work as a receiver using attiny84?