初级会员
- 积分
- 88
- 金钱
- 88
- 注册时间
- 2014-1-14
- 在线时间
- 0 小时
|
<div>以下是按照原子哥的例程改的<br />
<br />
</div>
<div><span class="Apple-tab-span" style="white-space:pre;"><div><span class="Apple-tab-span">发射<br />
<br />
</span>部分if(KEY1==0)</div>
<div><span class="Apple-tab-span"> </span>{</div>
<div><span class="Apple-tab-span"> </span>if(NRF24L01_TxPacket(tmp_buf)==TX_OK)</div>
<div><span class="Apple-tab-span"> </span> {</div>
<div><span class="Apple-tab-span"> </span>OINT_COLOR=BLUE;</div>
<div><span class="Apple-tab-span"> </span>Show_Str(10,120,"????????????????",16,0);<span class="Apple-tab-span"> </span></div>
<div><span class="Apple-tab-span"> </span>tmp_buf[0]=0x30+1; </div>
<div><span class="Apple-tab-span"> </span>LCD_ShowString(0,190,tmp_buf);<span class="Apple-tab-span"> </span></div>
<div><span class="Apple-tab-span"> </span> }</div>
<div><span class="Apple-tab-span"> </span>else</div>
<div><span class="Apple-tab-span"> </span> {<span class="Apple-tab-span"> </span> <span class="Apple-tab-span"> </span></div>
<div> <span class="Apple-tab-span"> </span>Show_Str(10,120,"?????????????§°?",16,0);<span class="Apple-tab-span"> </span> <span class="Apple-tab-span"> </span> </div>
<div><span class="Apple-tab-span"> </span> }LED1=0;</div>
<div><span class="Apple-tab-span"> </span>}<br />
<div style="white-space:normal;">接受部分:<br />
<br />
while(1)</div>
<div style="white-space:normal;"><span class="Apple-tab-span" style="white-space:pre;"> </span>{<span class="Apple-tab-span" style="white-space:pre;"> </span> <span class="Apple-tab-span" style="white-space:pre;"> </span> <span class="Apple-tab-span" style="white-space:pre;"> </span> <span class="Apple-tab-span" style="white-space:pre;"> </span> </div>
<div style="white-space:normal;"><span class="Apple-tab-span" style="white-space:pre;"> </span> if(NRF24L01_RxPacket(tmp_buf)==0)//??????????????,?ò????????.</div>
<div style="white-space:normal;"><span class="Apple-tab-span" style="white-space:pre;"> </span>{ </div>
<div style="white-space:normal;"><span class="Apple-tab-span" style="white-space:pre;"> </span></div>
<div style="white-space:normal;"><span class="Apple-tab-span" style="white-space:pre;"> </span>temp = tmp_buf[0];</div>
<div style="white-space:normal;"><span class="Apple-tab-span" style="white-space:pre;"> </span>LCD_ShowString(0,190,tmp_buf);</div>
<div style="white-space:normal;"> if(temp == 1)</div>
<div style="white-space:normal;"><span class="Apple-tab-span" style="white-space:pre;"> </span>{</div>
<div style="white-space:normal;"><span class="Apple-tab-span" style="white-space:pre;"> </span>GPIO_SetBits(GPIOA,GPIO_Pin_2);</div>
<div style="white-space:normal;"><span class="Apple-tab-span" style="white-space:pre;"> </span>delay_ms(100);</div>
<div style="white-space:normal;"><span class="Apple-tab-span" style="white-space:pre;"> </span>GPIO_ResetBits(GPIOA,GPIO_Pin_2);</div>
<div style="white-space:normal;"><span class="Apple-tab-span" style="white-space:pre;"> </span>delay_ms(100);</div>
<div style="white-space:normal;"> }<span class="Apple-tab-span" style="white-space:pre;"> </span></div>
<div style="white-space:normal;"><br />
</div>
<div style="white-space:normal;"> <span class="Apple-tab-span" style="white-space:pre;"> </span></div>
<div style="white-space:normal;"><span class="Apple-tab-span" style="white-space:pre;"> </span>}<span class="Apple-tab-span" style="white-space:pre;"> </span></div>
<div style="white-space:normal;"><span class="Apple-tab-span" style="white-space:pre;"> </span>}<span class="Apple-tab-span" style="white-space:pre;"> <br />
<div><span class="Apple-tab-span"> <br />
</span></div>
</span></div>
为什么接受部分的<span style="white-space:normal;"> tmp_buf[0]里面没有接受到数据呀?<br />
难道</span><span style="white-space:normal;"> tmp_buf[0]</span> 不是缓存寄存器么?<br />
<br />
<br />
</div>
</span></div> |
|