Loading...
  Show Posts
Pages: 1 ... 7 8 [9]
121  International / Italiano / Re: xBee accendere led D0 da remoto on: March 05, 2012, 06:47:00 am
ho lo stesso problema...
questo il mio codice:

Code:
#include <XBee.h>
XBee xbee = XBee();

void setup(){
xbee.begin(9600);
  Serial.println("Avvio programma...");
}
uint8_t cmdpin[] = {'D','1'};
uint8_t valore[] = { 4 };

XBeeAddress64 addr64 = XBeeAddress64(0x0013a200, 0x40812c22);

RemoteAtCommandRequest command = RemoteAtCommandRequest(addr64,cmdpin,valore,sizeof(valore));

void loop(){
  delay(1000);
  xbee.send(command);
  Serial.println("spento");

}

te hai risolto?
122  International / Italiano / Re: serialMode errore on: March 05, 2012, 06:03:16 am
Allego errore completo:
Code:
In file included from RFBee_Master.cpp:28:
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/Config.h:51: error: 'byte' does not name a type
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/Config.h:52: error: 'byte' has not been declared
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/Config.h:52: error: 'byte' has not been declared
In file included from RFBee_Master.cpp:29:
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/CCx.h:129: error: 'byte' does not name a type
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/CCx.h:130: error: 'byte' does not name a type
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/CCx.h:131: error: 'byte' does not name a type
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/CCx.h:132: error: 'byte' does not name a type
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/CCx.h:133: error: 'byte' does not name a type
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/CCx.h:139: error: 'byte' does not name a type
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/CCx.h:140: error: 'byte' has not been declared
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/CCx.h:143: error: 'byte' has not been declared
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/CCx.h:143: error: 'byte' has not been declared
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/CCx.h:145: error: 'byte' has not been declared
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/CCx.h:147: error: 'byte' does not name a type
In file included from RFBee_Master.cpp:30:
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:56: error: 'byte' does not name a type
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:57: error: 'byte' does not name a type
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:87: error: 'byte' does not name a type
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:88: error: 'byte' does not name a type
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:89: error: 'byte' does not name a type
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:90: error: 'byte' does not name a type
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: too many initializers for 'AT_Command_t'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: too many initializers for 'AT_Command_t'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: too many initializers for 'AT_Command_t'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: too many initializers for 'AT_Command_t'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: too many initializers for 'AT_Command_t'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: too many initializers for 'AT_Command_t'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: too many initializers for 'AT_Command_t'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: too many initializers for 'AT_Command_t'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: too many initializers for 'AT_Command_t'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: too many initializers for 'AT_Command_t'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: too many initializers for 'AT_Command_t'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: too many initializers for 'AT_Command_t'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: too many initializers for 'AT_Command_t'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: too many initializers for 'AT_Command_t'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: invalid conversion from 'int' to 'int (*)()'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: invalid conversion from 'int' to 'int (*)()'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: invalid conversion from 'int' to 'int (*)()'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: invalid conversion from 'int' to 'int (*)()'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: invalid conversion from 'int' to 'int (*)()'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: invalid conversion from 'int' to 'int (*)()'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: invalid conversion from 'int' to 'int (*)()'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: invalid conversion from 'int' to 'int (*)()'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:117: error: invalid conversion from 'int' to 'int (*)()'
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeSerial.h:120: error: 'byte' does not name a type
In file included from RFBee_Master.cpp:31:
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:34: error: variable or field 'transmitData' declared void
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:34: error: 'byte' was not declared in this scope
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:34: error: 'txData' was not declared in this scope
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:34: error: 'byte' was not declared in this scope
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:34: error: 'byte' was not declared in this scope
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:34: error: 'byte' was not declared in this scope
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:35: error: 'byte' was not declared in this scope
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:35: error: 'rxData' was not declared in this scope
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:35: error: 'byte' was not declared in this scope
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:35: error: 'len' was not declared in this scope
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:35: error: 'byte' was not declared in this scope
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:35: error: 'srcAddress' was not declared in this scope
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:35: error: 'byte' was not declared in this scope
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:35: error: 'destAddress' was not declared in this scope
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:35: error: 'byte' was not declared in this scope
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:35: error: 'rssi' was not declared in this scope
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:35: error: 'byte' was not declared in this scope
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:35: error: 'lqi' was not declared in this scope
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:35: error: initializer expression list treated as compound expression
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:36: error: 'byte' does not name a type
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:37: error: variable or field 'sleepNow' declared void
C:\arduino-1.0\libraries\RFBee_v1_1_for_RelayShield/rfBeeCore.h:37: error: 'byte' was not declared in this scope
RFBee_Master.cpp: In function 'void loop()':
RFBee_Master.pde:-1: error: 'serialMode' was not declared in this scope
RFBee_Master.pde:-1: error: 'class CONFIG' has no member named 'get'
RFBee_Master.cpp: In function 'void rfBeeInit()':
RFBee_Master.pde:-1: error: 'serialMode' was not declared in this scope
RFBee_Master.cpp: In function 'void controlRemoteRelayShield()':
RFBee_Master.pde:-1: error: 'class CONFIG' has no member named 'get'
RFBee_Master.pde:-1: error: 'class CONFIG' has no member named 'get'
RFBee_Master.pde:-1: error: 'transmitData' was not declared in this scope
123  International / Italiano / serialMode errore on: March 05, 2012, 05:56:53 am
Ciao a tutti,
sono nuovo del forum

ho acquistato questo modulo:
http://www.robot-italy.com/product_info.php?products_id=2083

e nel wiki: http://www.seeedstudio.com/wiki/index.php?title=Relay_Shield

con relativa documentazione di test: http://www.seeedstudio.com/wiki/images/6/66/RFBee_v1_1_for_RelayShield.zip

questo è lo sketch di prova:

Code:
//  Firmware for controling the remote relay shield
//  see www.seeedstudio.com for details and ordering rfBee hardware.

//  Copyright (c) 2010 Hans Klunder <hans.klunder (at) bigfoot.com>
//  Author: Hans Klunder, based on the original Rfbee v1.0 firmware by Seeedstudio
//  Version: July 14, 2010
//
//  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
//  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//  See the GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License along with this program;
//  if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA



//#define FIRMWAREVERSION 11 // 1.1  , version number needs to fit in byte (0~255) to be able to store it into config
//#define FACTORY_SELFTEST
//#define DEBUG

#include <avr/pgmspace.h>
#include <EEPROM.h>
#include "debug.h"
#include "globals.h"
#include "Config.h"
#include "CCx.h"
#include "rfBeeSerial.h"
#include "rfBeeCore.h"

#ifdef FACTORY_SELFTEST
#include <TestIO.h>  // factory selftest
#endif

#define GDO0 2 // used for polling the RF received data


//command used for controlling the remote relay shield,
//and different commands will be sent in interval in the loop
//command format:"RCXY"
//RC-command head
//X-which relay to be contorlled,X could be '0'-relay1,'1'-relay2, ... 'A'-relay11,'B'-relay12,(0-3 for group1, 4-8(controlled from Hub1) for group2, 9-B(controlled from Hub2) for group3)
//Y-which state the relay is to be set,Y could be '0'-set relay NO pin open,'1'-set realy NO pin close
//Note: This is just an demo on how to use RFBee in pair, and you can define your own commands.

byte relayCmd[4] = {'R','C','0','1'};


//=======================================================================
void setup(){
    if (Config.initialized() != OK)
    {
      Serial.begin(9600);
      Serial.println("Initializing config");
#ifdef FACTORY_SELFTEST
      if ( TestIO() != OK )
        return;
#endif
      Config.reset();
    }
    setUartBaudRate();
    rfBeeInit();
    Serial.println("ok");
}
//----------------------------------------------------------------------------------------
void loop(){

  //send cmmands to remote RFBee to control the relayshield in interval of 1s
  controlRemoteRelayShield();
  
  if (Serial.available() > 0){
    sleepCounter=1000; // reset the sleep counter
    if (serialMode == SERIALCMDMODE)
      readSerialCmd();
    else
      readSerialData();
  }
  
  if ( digitalRead(GDO0) == HIGH ) {
      writeSerialData();
      sleepCounter++; // delay sleep
  }
  sleepCounter--;
  
  // check if we can go to sleep again, going into low power too early will result in lost data in the CCx fifo.
  if ((sleepCounter == 0) && (Config.get(CONFIG_RFBEE_MODE) == LOWPOWER_MODE))
    DEBUGPRINT("low power on")
    lowPowerOn();
    DEBUGPRINT("woke up")
}
//===========================================================================================================

void rfBeeInit(){
    DEBUGPRINT()
    
    CCx.PowerOnStartUp();
    setCCxConfig();
  
    serialMode=SERIALDATAMODE;
    sleepCounter=0;
    
    attachInterrupt(0, ISRVreceiveData, RISING);  //GD00 is located on pin 2, which results in INT 0

    pinMode(GDO0,INPUT);// used for polling the RF received data

}

// handle interrupt
void ISRVreceiveData(){
  //DEBUGPRINT()
  sleepCounter=10;
}

//send cmmands to remote RFBee to control the relayshield in interval of 1s
void controlRemoteRelayShield()
{
//byte sendBuf[60];
//set group1 to group3 (relay 1~12)on or off
static char OnOff = 0;
OnOff = 1 - OnOff;
relayCmd[3] = OnOff + '0';

  for(int i = 0; i < 12; i++){
   if(i > 9){
   relayCmd[2] = i - 10 + 'A';
   }
   else{
   relayCmd[2] = i + '0';
   //memcpy(sendBuf+4*i,relayCmd,4);
   }
    transmitData(relayCmd,4,Config.get(CONFIG_MY_ADDR),Config.get(CONFIG_DEST_ADDR));
    //delay(1000);
  }
  delay(1000);
 
}

solo che l'IDE se ne esce con l'errore:

'serialMode' was not declared in thi scope

come posso risolvere?
Pages: 1 ... 7 8 [9]