ZigBee 无线通信实验

【实验内容】

使用 ZigBee 传输数据

【实验目的】

1. 掌握 Linux 串口编程;

2. 了解 ZigBee 简单原理;

【实验平台】 FS210 开发板、FS_CC2530ZigBee 模块、FS_11C14 开发板

【实验步骤】

内核配置: 增加内核支持 USB 转 Serial 驱动:PL2303

插上 ZigBee 模块(USB 接口)

FS_11C14 开发板连接 ZigBee 后上电;

内核启动后,执行命令: ./zigbee_test

打开 FS_11C14 物联网开发板,选择 ZigBee 选项,发送数据;

部分代码:

#include <stdio.h> 
#include <stdint.h> 
#include <stdlib.h> 
#include <string.h> 
#include <unistd.h> 
#include <errno.h> 
#include <fcntl.h> 
#include <time.h> 
#include <termios.h> 
 
#define BUF_LEN 128 
 
int fd_zigbee; 
 
int serial_init() 
{ 
 fd_zigbee = open("/dev/ttyUSB0", O_RDWR); 
 
 if(fd_zigbee < 0) 
 { 
 perror("open ttyUSB error."); 
 return -1; 
 } 
 
 struct termios options; 
 
 tcgetattr(fd_zigbee, &options); 
 options.c_cflag |= (CLOCAL | CREAD); 
 options.c_cflag &= ~CSIZE; 
 options.c_cflag &= ~CRTSCTS; 

【实验现象】

  • 8
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
cc2420+atmega128基础zigbee无线通信实验-接收和地址译码实验 实验内容 掌握如何使用cc2420的地址译码功能来接收帧 全套程序都放上 绝对有价值 可以看程序清单 ││adc_sensor.c 2.06 KB ││adc_sensor.h 638 bytes ││adc_sensor.lst 13.62 KB ││adc_sensor.o 8.75 KB ││avrhardware.c 4.27 KB ││avrhardware.h 5.06 KB ││avrhardware.lst 145.28 KB ││avrhardware.o 28.48 KB ││cc2420.c 14.83 KB ││cc2420.h 2.45 KB ││cc2420.lst 91.92 KB ││cc2420.o 21.36 KB ││CC2420Const.h 9.04 KB ││generic.h 1.67 KB ││interupter.c 1.00 KB ││interupter.h 604 bytes ││interupter.lst 9.94 KB ││interupter.o 8.24 KB ││led.c 3.16 KB ││led.h 828 bytes ││led.lst 22.97 KB ││led.o 11.01 KB ││main.c 3.17 KB ││main.cof 85.62 KB ││main.eep 13 bytes ││main.elf 62.09 KB ││main.hex 23.92 KB ││main.lss 178.26 KB ││main.lst 19.39 KB ││main.map 77.87 KB ││main.o 11.13 KB ││main.sym 13.38 KB ││Makefile 10.74 KB ││os.c 2.62 KB ││os.h 1.15 KB ││os.lst 17.67 KB ││os.o 5.92 KB ││project.h 1.60 KB ││receive_test.pnproj 758 bytes ││timer3.c 2.15 KB ││timer3.h 856 bytes ││timer3.lst 13.68 KB ││timer3.o 8.55 KB ││top.h 631 bytes ││uart0.c 1.04 KB ││uart0.h 691 bytes ││uart0.lst 6.68 KB ││uart0.o 4.56 KB
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

STM32单片机定制

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值