<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>NRF9E5 code problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/2002/nrf9e5-code-problem</link><description>Hi I&amp;#39;m looking to Program the NRF9E5 RX board so that the LED remains high until the switch is pressed on TX. So the TX button would turn the LED high and remain so until the TX Switch is pressed. I would like to do this for two LEDs. But for the code</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Apr 2014 15:20:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/2002/nrf9e5-code-problem" /><item><title>RE: NRF9E5 code problem</title><link>https://devzone.nordicsemi.com/thread/8581?ContentTypeID=1</link><pubDate>Thu, 10 Apr 2014 15:20:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd686bf6-5449-4649-b977-60f3c795a7b3</guid><dc:creator>John</dc:creator><description>&lt;p&gt;Hi Torbjørn,&lt;/p&gt;
&lt;p&gt;Thanks for your Reply.&lt;/p&gt;
&lt;p&gt;I have the transmitter just set at P0_DIR=0XFF;&lt;/p&gt;
&lt;p&gt;Would I have to set the coressponding switch for the LED on the tx side?&lt;/p&gt;
&lt;p&gt;Have changed the code to remove the loop.&lt;/p&gt;
&lt;p&gt;I think that it is checking the recieve packet for a 1 to turn on P0.2?&lt;/p&gt;
&lt;p&gt;Basically like a wireless light switch is what I&amp;#39;m looking&lt;/p&gt;
&lt;p&gt;I have attached the code below and have the updated code here.
void Receiver(void)
void Delay500us(volatile unsigned char n)&lt;/p&gt;
&lt;p&gt;{
unsigned char b;
unsigned char b1,b2;
unsigned char oldb1,oldb2;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;TXEN = 0;
for(;;)
{
    b = ReceivePacket();
			b1= b&amp;amp;amp;0;//0010
			//b2=b&amp;amp;amp;2;//0100
			oldb1=P0.2;
			//oldb2=P.2;
    
			p0.2=~p0.2;
			delay_ms(500);
   }
			if(p0.2==0) 
			p0.2 = 1;  
			else p0.2 = 0; 
		}
		end if;
		}
	
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;void Init(void)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9E5 code problem</title><link>https://devzone.nordicsemi.com/thread/8582?ContentTypeID=1</link><pubDate>Thu, 10 Apr 2014 15:12:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4db7cd05-fce8-4607-a0ea-27398b1ae028</guid><dc:creator>John</dc:creator><description>&lt;p&gt;Hi Torbjørn,&lt;/p&gt;
&lt;p&gt;Thanks for your Reply.&lt;/p&gt;
&lt;p&gt;I have the transmitter just set at P0_DIR=0XFF;&lt;/p&gt;
&lt;p&gt;Would I have to set the coressponding switch for the LED on the tx side?&lt;/p&gt;
&lt;p&gt;Have changed the code to remove the loop.&lt;/p&gt;
&lt;p&gt;I think that it is checking the recieve packet for a 1 to turn on P0.2?&lt;/p&gt;
&lt;p&gt;Basically like a wireless light switch is what I&amp;#39;m looking&lt;/p&gt;
&lt;p&gt;I have attached the code below and have the updated code here.
void Receiver(void)
void Delay500us(volatile unsigned char n)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{
    unsigned char b;
		unsigned char b1,b2;
		unsigned char oldb1,oldb2;
		
	
    TXEN = 0;
    for(;;)
    {
        b = ReceivePacket();
				b1= b&amp;amp;0;//0010
				//b2=b&amp;amp;2;//0100
				oldb1=P0.2;
				//oldb2=P.2;
        
				p0.2=~p0.2;
				delay_ms(500);
       }
				if(p0.2==0) 
				p0.2 = 1;  
				else p0.2 = 0; 
			}
			end if;
			}
		


void Init(void)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Any help would be greatly appreciated&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9E5 code problem</title><link>https://devzone.nordicsemi.com/thread/8580?ContentTypeID=1</link><pubDate>Fri, 28 Mar 2014 17:31:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a858b04-3974-40c1-b73c-80356efd182d</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi John&lt;/p&gt;
&lt;p&gt;Please use the code tag to include code, otherwise the formatting will be messy ;)&lt;/p&gt;
&lt;p&gt;It seems you are blinking P0.2 in an infinite loop, which doesn&amp;#39;t really make sense if you are waiting for button input.
What pin are you using for the button?&lt;/p&gt;
&lt;p&gt;Best regards
Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>