极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 17660|回复: 0

使用RDA5807M和KT0803的ARDUINO简易对讲机程序设计

[复制链接]
发表于 2018-9-20 07:35:18 来自手机 | 显示全部楼层 |阅读模式
程序还没有全部写完,只是弄出了个框架,特别是收发转换那里。发在这里供大家讨论与完善程序。设定工作频率为108MHZ
#include <Arduino.h>
#include <Wire.h>
#include <radio.h>
#include <RDA5807M.h>
#include <FMTX.h>

RDA5807M radio;    // Create an instance of Class for RDA5807M Chip

RADIO_INFO ri;//rssi

float fm_freq = 108;
void rx(void);
void tx(void);

void setup() {
pinMode(3, INPUT);

  //sets interrupt to check for button talk abutton press
  attachInterrupt(1, tx, CHANGE);
  
  //sets the default state for each module to recevie
  rx(); // put your setup code here, to run once:

}

void rx(void)
{
  radio.init();
radio.setFrequency(10800);
  // Enable information to the Serial port
  //radio.debugEnable();

//radio.setBandFrequency(FIX_BAND, FIX_STATION );
  radio.setVolume(4);
  radio.setMono(false);
  radio.setMute(false);
}

void tx(void)
{
  fmtx_init(fm_freq, CHINA);
  fmtx_set_freq(fm_freq);
}

void loop() {
radio.getRadioInfo(&ri);//mute control
if((ri.rssi)>=7)
radio.setMute(false);

else if((ri.rssi)<7)
radio.setMute(true);  // put your main code here, to run repeatedly:

}
//arduino FM walkie talkie
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 需要先绑定手机号

Archiver|联系我们|极客工坊

GMT+8, 2024-4-23 15:36 , Processed in 0.053198 second(s), 18 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表