mylife1213 发表于 2015-2-8 13:42:30

huan 发表于 2015-2-8 13:21 static/image/common/back.gif
我的编译会出现D:\arduino-1.5.2-windows\arduino-1.5.2\libraries\nrf24l01\Multiple.cpp: In member func ...

麻烦说下是用了那个例程,还有用的是那个arduino的硬件,库下的是版本号为v1.1的吗

huan 发表于 2015-2-8 13:47:42

mylife1213 发表于 2015-2-8 13:42 static/image/common/back.gif
麻烦说下是用了那个例程,还有用的是那个arduino的硬件,库下的是版本号为v1.1的吗

刚下的库,arduino uno r3 编译器是1.5.2,里面带的几个例程都会,谢谢

mylife1213 发表于 2015-2-8 13:58:37

huan 发表于 2015-2-8 13:47 static/image/common/back.gif
刚下的库,arduino uno r3 编译器是1.5.2,里面带的几个例程都会,谢谢

我刚才使用arduino 1.5.8试过了,没有出现错误提示,你试一下去下载新版来试一下 http://arduino.cc/download.php?f=/arduino-1.5.8-windows.zip 这是下载地址

mylife1213 发表于 2015-2-8 14:11:26

本帖最后由 mylife1213 于 2015-2-8 14:22 编辑

leicheng 发表于 2015-2-8 13:31 static/image/common/back.gif
或许是底层硬件搞多了,还是没跳出来,你以为是玩uscos吗~
我说的其他改进建议是在windows/android上开 ...

懂你说的了,你是想让我加入跳频协议吧

huan 发表于 2015-2-8 14:41:06

mylife1213 发表于 2015-2-8 13:58 static/image/common/back.gif
我刚才使用arduino 1.5.8试过了,没有出现错误提示,你试一下去下载新版来试一下 http://arduino.cc/down ...

使用1.5.8已经可以正常编译下载了,感谢

mylife1213 发表于 2015-2-8 15:07:40

huan 发表于 2015-2-8 14:41 static/image/common/back.gif
使用1.5.8已经可以正常编译下载了,感谢

不客气,;;;:)

mylife1213 发表于 2015-2-8 16:40:30

leicheng 发表于 2015-2-8 13:31 static/image/common/back.gif
或许是底层硬件搞多了,还是没跳出来,你以为是玩uscos吗~
我说的其他改进建议是在windows/android上开 ...

对于一个多路通信如果引入跳频信道的话只会增加线路的不稳定性,而且设计难度太大。单路引入跳频通信实现简单,只要在发送的时候检测是否发送信道CD寄存器是否置位,如果是的话就在数据中加入下次通信的信道,接收端只要收到数据中存在改变信道的数据那么就马上切换信道。5路通信的跳频还是请专门研究通信协议的专家来解决吧

pqy39 发表于 2015-3-13 22:08:59

发送端TX地址为0x03,为什么结果显示接收端通道为0?应该为第3通道呀?

lyc63089637 发表于 2015-4-20 23:26:31

我把spi_send的文件下载在多个arduino控制器, 一个接受,发现可行,但是都是channel 0,当我发射端用Nrf.set_reg("Channel","1")时,接收端就就接受不到信息,是不是接收端也要这样设置? 但是我发射端,接收端都设置了,还是接受不到信息。。。。。

雨轩 发表于 2015-5-31 11:04:31

想控制六路继电器该怎么实现?想用DHT11发送温湿度数据又该怎么实现?

雨轩 发表于 2015-5-31 11:09:22

glmyc 发表于 2014-12-15 21:18 static/image/common/back.gif
这个是好东东,用一个MINI PRO做一个室外天气测量装置
通过空气质量传感器、温湿度传感器、雨水传感器、光 ...

怎么弄?只要发送DHT11温湿度数据就好了

雨轩 发表于 2015-5-31 11:16:09

mega2560作为主机连接W5100接上网线通过yeelink发送六路开关信号到从机,怎么实现
/*
Yeelink sensor client power switch example
*/

#include <SPI.h>
#include <Ethernet.h>
#include <Wire.h>
#include <math.h>

byte buff;



// for yeelink apiapi.yeelink.net      LED    /v1.0/device/10964/sensor/18179/datapoints
#define APIKEY         "47412e01ab744a131cb8da0e64d7e040" // 此处替换为你自己的API KEY
#define DEVICEID       10964 // 此处替换为你的设备编号

char flag =0;//定义开关循环控制变量

//#define SENSORID1      19581 // 此处替换为你的传感器编号
//#define SENSORID2      19582

String SENSORID[]={"19581","19582"}; // 把sensor ID 依次替在这里,程序定义为数组,几个开关就写几个

byte ledPin[]={5,6};



// assign a MAC address for the ethernet controller.
byte mac[] = { 0x00, 0x1D, 0x72, 0x82, 0x35, 0x9D};
// initialize the library instance:
EthernetClient client ;
char server[] = "api.yeelink.net";   // name address for yeelink API

unsigned long lastConnectionTime = 0;          // last time you connected to the server, in milliseconds
boolean lastConnected = false;               // state of the connection last time through the main loop
const unsigned long postingInterval = 3*1000; // delay between 2 datapoints, 30s
String returnValue = "";
boolean ResponseBegin = false;

void setup() {

pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
   
for(int i=0;i<2;i++)       //I<7,几个开关,就把7改成几,其实就是循次数
{ pinMode(ledPin,OUTPUT);}



Wire.begin();

// start serial port:
Serial.begin(57600);

// start the Ethernet connection with DHCP:
if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    for(;;)
      ;
}
else {
    Serial.println("Ethernet configuration OK");
}
}

void loop() {
// if there's incoming data from the net connection.
// send it out the serial port.This is for debugging
// purposes only:

if (client.available()) {
    char c = client.read();
   // Serial.print(c);
      if (c == '{')
      ResponseBegin = true;
      else if (c == '}')
      ResponseBegin = false;

      if (ResponseBegin)
      returnValue += c;   
}
if (returnValue.length() !=0 && (ResponseBegin == false))
{
    Serial.println(returnValue);
   
    if (returnValue.charAt(returnValue.length() - 1) == '1') {
      Serial.println("turn on the LED");
      
      
      digitalWrite(ledPin, HIGH);
      
      
    }
      else if(returnValue.charAt(returnValue.length() - 1) == '0') {
      Serial.println("turn off the LED");
      digitalWrite(ledPin, LOW);
    }
   returnValue = "";
   flag++;
}


// if there's no net connection, but there was one last time
// through the loop, then stop the client:
if (!client.connected() && lastConnected) {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();
}

// if you're not connected, and ten seconds have passed since
// your last connection, then connect again and send data:


if(!client.connected() && (millis() - lastConnectionTime > postingInterval)) {
    // read sensor data, replace with your code
    //int sensorReading = readLightSensor();
    Serial.print("yeelink:");
    //get data from server
   // getData();
   
               
               if (flag<2)
                {
                  //get data from server
                  getData();   
                }
                else
            {
                  //put data to server

                  if(flag=3) {flag =0;}
                }


   
}

// store the state of the connection for next time through
// the loop:
lastConnected = client.connected();
}







// this method makes a HTTP connection to the server and get data back
void getData(void) {
// if there's a successful connection:
if (client.connect(server, 80)) {
    Serial.println("connecting...");
    // send the HTTP GET request:
   
    client.print("GET /v1.0/device/");
    client.print(DEVICEID);
    client.print("/sensor/");
    //client.print(SENSORID2);
    //SENSORID={"19581","19582"};
    client.print(SENSORID);
    client.print("/datapoints");
    client.println(" HTTP/1.1");
    client.println("Host: api.yeelink.net");
    client.print("Accept: *");
    client.print("/");
    client.println("*");
    client.print("U-ApiKey: ");
    client.println(APIKEY);
    client.println("Content-Length: 0");
    client.println("Connection: close");
    client.println();
    Serial.println("print get done.");
   
}
else {
    // if you couldn't make a connection:
    Serial.println("connection failed");
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();
}
   // note the time that the connection was made or attempted:
lastConnectionTime = millis();

怎么插入24l01的代码来控制从机?

terrymty 发表于 2015-9-2 10:08:38

楼主,这个Arduino uno 的中断应该用的是哪个引脚啊?

swjtutl 发表于 2015-9-22 16:35:40

似乎有点小bug:
(1)Interrup_read(uint8_t channel,uint8_t* data)好像应该是Interrup_read(uint8_t &channel,uint8_t* data)
(2)rx_addr_p2_5,这个数组貌似第一位还是通道1的地址,修改成rx_addr_p2_5={0x01,0x02,0x03,0x04,0x05}就对了。
其它还在测试中,总而言之,非常感谢楼主的无私奉献,节省了我等大量时间

smallfivecn 发表于 2015-11-24 14:56:07

感谢楼主的无私奉献,赞楼主的开源精神!
页: 1 2 3 [4] 5
查看完整版本: 认真的nrf24l01库 5路接收通道 2月6号_更新用户模式选择