سلام . من برنامه راهاندازی nrf را سایت گرفتم ولی گیرنده فقط 0و255 را نشان می دهد ممنون میشم اگر کمکم کنید
کد resiver :
[#include <mega16.h>
#include <nRF24L01+.h>
#include <stdio.h>
#include <delay.h>
#include <alcd.h>
char data1,str[33];
void main(void)
{
DDRA=0xFF;
// Alphanumeric LCD initialization
// Connections are specified in the
// Project|Configure|C Compiler|Libraries|Alphanumeric LCD menu:
// RS - PORTA Bit 0
// RD - PORTA Bit 1
// EN - PORTA Bit 2
// D4 - PORTA Bit 4
// D5 - PORTA Bit 5
// D6 - PORTA Bit 6
// D7 - PORTA Bit 7
// Characters/line: 16
lcd_init(16);
lcd_clear();
lcd_gotoxy(0,0);
lcd_puts("Reciver"
;
delay_ms(2000);
nRF_Config(1);
while (1)
{
if(State == 1)
{
data1 = payload[1];
lcd_gotoxy(0,1);
lcd_puts(" "
;
sprintf(str,"Data = %d",data1);
lcd_gotoxy(0,1);
lcd_puts(str);
State = 0;
}
}
}
کد فرستنده :
#include <mega16.h>
#include <stdio.h>
#include <delay.h>
#include <nRF24L01+.h>
#include <alcd.h>
char data1,str[20];
void main(void)
{
// Declare your local variables here
DDRA=0xFF;
// Alphanumeric LCD initialization
// Connections are specified in the
// Project|Configure|C Compiler|Libraries|Alphanumeric LCD menu:
// RS - PORTA Bit 0
// RD - PORTA Bit 1
// EN - PORTA Bit 2
// D4 - PORTA Bit 4
// D5 - PORTA Bit 5
// D6 - PORTA Bit 6
// D7 - PORTA Bit 7
// Characters/line: 16
lcd_init(16);
nRF_Config(0);
while (1)
{
data1++;
Send_Data(1 , &data1);
lcd_gotoxy(0,0);
sprintf(str,"Data=%d",data1);
lcd_puts(str);
delay_ms(1000);
}
}
کد resiver :
[#include <mega16.h>
#include <nRF24L01+.h>
#include <stdio.h>
#include <delay.h>
#include <alcd.h>
char data1,str[33];
void main(void)
{
DDRA=0xFF;
// Alphanumeric LCD initialization
// Connections are specified in the
// Project|Configure|C Compiler|Libraries|Alphanumeric LCD menu:
// RS - PORTA Bit 0
// RD - PORTA Bit 1
// EN - PORTA Bit 2
// D4 - PORTA Bit 4
// D5 - PORTA Bit 5
// D6 - PORTA Bit 6
// D7 - PORTA Bit 7
// Characters/line: 16
lcd_init(16);
lcd_clear();
lcd_gotoxy(0,0);
lcd_puts("Reciver"

delay_ms(2000);
nRF_Config(1);
while (1)
{
if(State == 1)
{
data1 = payload[1];
lcd_gotoxy(0,1);
lcd_puts(" "

sprintf(str,"Data = %d",data1);
lcd_gotoxy(0,1);
lcd_puts(str);
State = 0;
}
}
}
کد فرستنده :
#include <mega16.h>
#include <stdio.h>
#include <delay.h>
#include <nRF24L01+.h>
#include <alcd.h>
char data1,str[20];
void main(void)
{
// Declare your local variables here
DDRA=0xFF;
// Alphanumeric LCD initialization
// Connections are specified in the
// Project|Configure|C Compiler|Libraries|Alphanumeric LCD menu:
// RS - PORTA Bit 0
// RD - PORTA Bit 1
// EN - PORTA Bit 2
// D4 - PORTA Bit 4
// D5 - PORTA Bit 5
// D6 - PORTA Bit 6
// D7 - PORTA Bit 7
// Characters/line: 16
lcd_init(16);
nRF_Config(0);
while (1)
{
data1++;
Send_Data(1 , &data1);
lcd_gotoxy(0,0);
sprintf(str,"Data=%d",data1);
lcd_puts(str);
delay_ms(1000);
}
}