This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

cannot able to transmit the address through UART

hi all, i am using sdk v8. i want to transmit the address through uart and read the data using UART. i am using app_uart_get and app_uart_put api's.

PROBLEM: if i connect my nodic transmitter and receiver uart pin to the ( SLAVE DEVICE) , address is not at all transmitting. please give me possible solutions. i attached my code also.

uint8_t st;
get: while(app_uart_get(&st)!=NRF_SUCCESS);
if(st=='s')
{
		while(1)
		{
	//		printf("\r\n %d \r\n",BSP_EVENT_KEY_0);
//uint8_t data[]="150";
	uint8_t data=0x96;		
			uint8_t ch;
			//uint8_t arr[50];
		static	int i=0;
while(app_uart_put(data)!=NRF_SUCCESS);
			
//			for(i=0;data[i];i++)
//			{

//        while(app_uart_put(data[i]) != NRF_SUCCESS);

//			}
			printf("\r\n");
	//		i=0;
			while(1)
			{
				char arr[50];
				//printf("empty string=%s\r\n",arr);				
     while(app_uart_get(&ch));
			while(app_uart_put(ch));
		//		printf("\r\nascii=%d\r\n",ch);
			arr[i++]=ch;	
				//printf("array char =%c\r\n",arr[i-1]);
				
				if((int)ch==13)
				{	
					LEDS_ON(LEDS_MASK);
				printf("\r\nstring=%s\r\n",arr);
				//	strcpy(arr,"");
					//printf("\r\n array1=%s\r\n",arr);
					i=0;
					//arr[i]='\0';
					//nrf_delay_ms(1000);
			//		LEDS_OFF(LEDS_MASK);
				//	app_uart_flush();
					while(1);
				}
				//printf("\r\n array content2=%s\r\n",arr);
				
				
			}
		
		//printf("\r\n array content2=%s\r\n",arr);
	while(1)
		{
	}
}
}
Parents
  • A little bit difficult to see what is going on here and what is the problem. What slave device are you communicating with? What is this "address"? Why do you have while(1) inside the function (multiple places) without any way to exit it? And please remove all the commented out code.

Reply
  • A little bit difficult to see what is going on here and what is the problem. What slave device are you communicating with? What is this "address"? Why do you have while(1) inside the function (multiple places) without any way to exit it? And please remove all the commented out code.

Children
No Data
Related