ImageVerifierCode 换一换
格式:DOCX , 页数:67 ,大小:50.13KB ,
资源ID:7343656      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/7343656.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(无线传感网络课程设计.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

无线传感网络课程设计.docx

1、无线传感网络课程设计无线传感网络课程设计报告 姓名:胡韶辉 胡衎学号:139074377 139074376班级:物131班指导教师:卫琳娜 2017年1月1日无线传感网络课程设计实验一、无线传感网络点对点通信实验1.实验内容此实验为验证实验,根据实验步骤进行实验,观察结果是否与预期相符2实验步骤 用IAR8.1打开路径:C:UsersxsDesktop无线传感器网络课程设计无线传感网实验资料201604感知RF2-2530WSNV1.2代码和例子程序Light_SwitchIDELight_Switchsrf05_cc2530IarLight_Switch.eww分别编译并下载至两个节点上,

2、打开节点,左右键选择/,选择完成后按中间键确认,观察LED灯显示情况。3.实验代码及分析/*功 能:查找字符在索引中的哪一个位置*/*/static u16 lookforChar( u8 ch ) uint16 i; for( i = 0; i FONTLISTCOUNT; i + ) if( fontListi = ch ) return i; return i;/查中文static u16 lookforChar16( u16 ch ) uint16 i,j; u16 temp16; for( i = 0; i fontChar16ListCount; i + ) j = i*2; te

3、mp16 = fontChar16Listj + 1; temp16 8);void LcdPutString8( u8 x,u8 y,u8 *ptr u8 len,u8 op ) u8 i,*tptr = ptr,xx = x,yy = y; u16 m; if( x 95) return ; if( y 1) return ; for( i = 0;i 88 ) return; */void LcdClearRam( void ) u8 i; for( i = 0;i 96;i + ) LcdBuf0i = 0; for( i = 0;i 95) return ; if( yy ) ret

4、urn ; for( i = 0;i len; i + ) m = lookforChar(*tptr +); if( m != FONTLISTCOUNT ) m = m * 16; for( j = 0;j 96 ) return; PutPic( (void *)LcdBuf );/显示16*16字符void LcdPutString16_16( u8 x,u8 y,u8 *ptr,u8 len,u8 op ) u8 i,j,*tptr = ptr,xx = x,yy = y; u16 m; if( xx 95) return ; if( yy ) return ; for( i = 0

5、;i len; i + ) m = lookforChar(*tptr +); if( m != FONTLISTCOUNT ) m = m * 32; for( j = 0;j 80 ) return; PutPic( (void *)LcdBuf );static void LcdPrint8( u8 x,u8 y,u8 vl,u8 op ) u8 j; u16 m; m = lookforChar( vl ); if( m != FONTLISTCOUNT ) m = m * 16; for( j = 0;j 8;j + ) if(op) LcdPutChar8( (x + j),y,f

6、ontm+j ); LcdPutChar8( (x + j),y+1,fontm+j+8 ); else LcdPutChar8( (x + j),y,fontm+j ); LcdPutChar8( (x + j),y+1,fontm+j+8 ); static void LcdPrint16( u8 x, u8 y, u16 val, u8 op ) u8 j; u16 m; m = lookforChar16( val ); if( m != fontChar16ListCount ) m = m * 32; for( j = 0;j 88 ) return ; if( y 1 ) ret

7、urn; while( (*tptr != 0) & ( tcount = 88) ) if(*tptr 127) /显示ASIC码 LcdPrint8( tcount,y,*tptr,op ); tptr +; tcount += 8; else /显示汉字 temp16 = tptr1; temp16 88 ) return ; if( y 1 ) return; while( (*tptr != 0) & ( tcount = 88) ) if(*tptr 127) /显示ASIC码 LcdPrint8( tcount,y,*tptr,op ); tptr +; tcount += 8;

8、 else /显示汉字 temp16 = tptr1; temp16 = 8; temp16 |= tptr0; LcdPrint16( tcount,y,temp16,op ); tptr += 2; tcount += 16; PutPic( (void *)LcdBuf );/从右往左输出一组字符并移运显示void LcdPutScDispRtoL( OledCodeDataType *ptr,u8 op,u16 dl ) OledCodeDataType *tptr = ptr; u16 temp16;/ LcdClearRam(); while( *tptr != 0 ) if(*t

9、ptr 127) /显示ASIC码 memcpy(LcdBuf0,&LcdBuf08,88); memcpy(LcdBuf1,&LcdBuf18,88); LcdPrint8( 88,0,*tptr,op ); tptr +; else /显示汉字 memcpy(LcdBuf0,&LcdBuf016,80); memcpy(LcdBuf1,&LcdBuf116,80); temp16 = tptr1; temp16 = 8; temp16 |= tptr0; LcdPrint16( 80,0,temp16,op ); tptr += 2; PutPic( (void *)LcdBuf ); L

10、cdDelay( dl ); void LcdPutScDispRtoL12( OledCodeDataType *ptr,u8 op,u16 dl ) OledCodeDataType *tptr = ptr; u16 i,temp16; for( i = 0;i 12;) if(*tptr 127) /显示ASIC码 memcpy(LcdBuf0,&LcdBuf08,88); memcpy(LcdBuf1,&LcdBuf18,88); LcdPrint8( 88,0,*tptr,op ); tptr +; i + ; else /显示汉字 memcpy(LcdBuf0,&LcdBuf016

11、,80); memcpy(LcdBuf1,&LcdBuf116,80); temp16 = tptr1; temp16 = 8; temp16 |= tptr0; LcdPrint16( 80,0,temp16,op ); tptr += 2; i +=2; PutPic( (void *)LcdBuf ); LcdDelay( dl ); /从左往右void LcdPutScDispLtoR12( OledCodeDataType *ptr,u8 op,u16 dl ) OledCodeDataType *ttptr,*tptr = ptr; u16 temp16; u8 i,len,tem

12、pbuf296; len = 12; tptr = ptr+11; for( i = 0; i len; ) if( *(tptr) 127 ) /显示ASIC码 memcpy(&tempbuf00,&LcdBuf00,96 ); memcpy(&tempbuf10,&LcdBuf10,96 ); memcpy(&LcdBuf08,&tempbuf00,88); memcpy(&LcdBuf18,&tempbuf10,88); LcdPrint8( 0,0,*tptr,op ); tptr -; i +; else /显示汉字 memcpy(&tempbuf00,&LcdBuf00,96 );

13、 memcpy(&tempbuf10,&LcdBuf10,96 ); memcpy(&LcdBuf016,&tempbuf00,80); memcpy(&LcdBuf116,&tempbuf10,80); ttptr = tptr; temp16 = *ttptr; temp16 95) | (x + w) 96) ) return; if( (y 1) | (y + h) 2) return; for( i = 0;i w; i + ) if(op) LcdBufyx + i = *tptr ; if( h = 2 ) LcdBufy+1x + i = *(tptr+w); tptr +;

14、else LcdBufyx + i = *tptr ; if( h = 2 ) LcdBufy+1x + i = *(tptr+w); tptr +; PutPic( (void *)LcdBuf );/整屏滑动显示void LcdPutScPic( OledCodeDataType *ptr, u8 op,u8 qp,u16 dl ) u8 i,j; u8 tempbuf296; if(qp) for( i = 0 ;i 96; i + ) tempbuf0i = *ptr+; for( i = 0 ;i 96; i + ) tempbuf1i = *ptr+; else for( i =

15、0 ;i 96; i + ) tempbuf0i = *ptr+; for( i = 0 ;i 96; i + ) tempbuf1i = *ptr+; switch( op ) case RIGHT_SC: /右边 for( i = 0; i 8; i + ) for(j = 0;j 84; j + ) LcdBuf095-j = LcdBuf083 - j; LcdBuf195-j = LcdBuf183 - j; for( j = 0;j 12; j + ) LcdBuf011-j = tempbuf095 - j; LcdBuf111-j = tempbuf195 - j; for(j

16、 = 0;j 84; j + ) tempbuf095-j = tempbuf083 - j; tempbuf195-j = tempbuf183 - j; PutPic( (void *)LcdBuf ); LcdDelay( dl ); break; case LIFT_SC: /左边 for( i = 0; i 8; i + ) for(j = 0;j 84; j + ) LcdBuf0j = LcdBuf0j + 12; LcdBuf1j = LcdBuf1j + 12; for( j = 0;j 12; j + ) LcdBuf095-j = tempbuf011-j; LcdBuf195-j = tempbuf111-j; for(j = 0;j 84; j + ) tempbuf0j = tempbuf0j+12; tempbuf

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1