Show Posts
Pages: 1 2 [3] 4 5 ... 13
31  Using Arduino / Programming Questions / Re: xbee and arduino due on: April 08, 2013, 05:16:04 am
thank you for your reply !!

But !! I am sorry , i don't get it.. In fact i a using a shield (on it is mounted my xbee)
I don't get the idea of using HW ports smiley-sad
I can't solve the problem with changing in the code ?

Can you please explain more ?

Ok, which example and library  you are using?
32  Using Arduino / Programming Questions / Re: xbee and arduino due on: April 08, 2013, 05:08:54 am
I can confirm that the Xbee Library works on DUE.  I ported over my code and tested last night.

http://code.google.com/p/xbee-arduino/

Reference: http://arduino.cc/forum/index.php/topic,144446.15.html

Follow the link and verify that. smiley-cool
33  Using Arduino / Programming Questions / Re: xbee and arduino due on: April 08, 2013, 04:47:56 am
But when I verify it using the Arduino IDE, with Arduino Due, it gives me the next message:

    "/arduino-1.5.2/libraries/SoftwareSerial/SoftwareSerial.cpp:41: fatal error: avr/interrupt.h: No such file or directory
    compilation terminated."

Error is not strange. All other boards have AVR MCU and on this one not...

Quote
What can i do?

If i am not wrong Due has 4 HW serial port and it would be nice if you go for them.


Edit: The Due has a dedicated forum for discussing the board.
34  Using Arduino / Programming Questions / Re: Home Automation with Android app - Need some idea ! on: April 04, 2013, 08:38:21 am
Anybody know how it works in commercials home automation apps ?

Yes, If the Application support the long range controlling IoT.
Device -> Online Cloud(Broker)<- Client Application
35  Using Arduino / Programming Questions / Re: Home Automation with Android app - Need some idea ! on: April 04, 2013, 08:34:08 am
Quote
This is the problem.
No. That is what a server is SUPPOSED to do. Service a client and then forget that the client exists.
Yes i know, "That is what a server" In my view if it will be clent and server is place some where on CLOUDS smiley-cool "A Broker" sharing point for all client app.
36  Using Arduino / Programming Questions / Re: code from UNO to MEGA on: April 04, 2013, 12:59:49 am
i have code that works well with the uno. but it doesnt work with the mega. it involves a module and a softserial. on the UNO the module is detected bia softserial. on the MEGA i also used softserial but somehow there's not communication with the module. but it  says on the description the MEGA supports softserial

Limitations
The library has the following known limitations:
If using multiple software serial ports, only one can receive data at a time.
Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69
37  Using Arduino / Programming Questions / Re: Basic Serial Out issue with Array on: April 04, 2013, 12:48:59 am
Which MCU/board you are using?

defining some thing below the setup() is not right place.

Code:
#define SIZE 10
void setup(){
  Serial.begin(115200);
}

void loop(){
  int in[SIZE]={0};
  int on[SIZE]={0};
  Serial.println("abc");
  for(int i = 0; i < SIZE; i++){
    Serial.println("abc");
    Serial.println(in[i]);
    //Serial.println("abc");
    Serial.println(on[i]);
    //Serial.println("abc");
    delay(500);
  }
  Serial.println("abc");
}

By following above style/rule of code i hope it will run. One more thing, size of array EDIT:/variable depend on MCU RAM.

38  Using Arduino / Programming Questions / Re: Mitsubishi IR AC remote decoding Problem on: April 04, 2013, 12:31:25 am
@Cybernetician.. Thanks. It seems exacly the same codding scheme. Would you like to share the discription of that scheme.

Ok, Why not.

PFA, In attachment lots of detail available about different coding schemes. And by modification(reverse engineering) in your code, I hope you will find the solution.

Edit: http://read.pudn.com/downloads157/sourcecode/embed/701593/docs/IR%20Formats%202.PDF
39  Using Arduino / Programming Questions / Re: Mitsubishi IR AC remote decoding Problem on: April 04, 2013, 12:17:11 am
@ arslankhan and diegt

It's seems me that you guys facing the world most difficult coding scheme. Japanese Association for Electric Home Appliances has produced a standard for IR control "Japanese code".

and simple IRremote library haven't capability of extracting the whole logic behind the scene.
40  Using Arduino / Programming Questions / Re: Home Automation with Android app - Need some idea ! on: April 03, 2013, 11:31:43 pm
Quote
my sketch disconnects the user after each request

This is the problem.

Quote
I was thinking about doing the android requests the devices's status every second,

In my view

1)Whenever user run the app and SignIn it will update the status of device by generating the android request.

2) Put the button(GUI) in your app and whenever User press the button it will generate android request for the devices's status.
41  Using Arduino / Programming Questions / Re: If statement not executing more than once "Serial.available();" on: April 03, 2013, 11:20:36 pm
YEAH!!!, it works thanx to the always supporting people in this forums!!! smiley

Cheers. smiley-cool
42  Using Arduino / Programming Questions / Re: If statement not executing more than once "Serial.available();" on: April 03, 2013, 11:16:59 pm
Ok, did you run the code of "MY last comment" i think so it will solve your problem.

Code:
char myval[] = "0800";
char inChar;
byte index = 0;

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  // First extract all the data
  while(Serial.available() > 0)
  {
    if(index < 4)
    {
      inChar = Serial.read();
      myval[index] = inChar;
      index++;
      Serial.println(index);
    }
  }
  ////////////////////////////
  //// Null terminator//////////
  myval[index] = '\0';

 ///THIS IS YOUR LOGIC AREA///
  if(index >= 4)
  {
    int nb1 = myval[0] - '0';
    int nb2 = myval[1] - '0';
    int nb3 = myval[2] - '0';
    int nb4 = myval[3] - '0';

    int result1;
    result1 = nb1*1000 + nb2*100 + nb3*10 + nb4;   // get minites     
    Serial.print("result1=");
    Serial.println(result1);
    delay(50);
    index = 0;
  }
}
43  Using Arduino / Programming Questions / Re: If statement not executing more than once "Serial.available();" on: April 03, 2013, 11:00:24 pm
First it's really hard to understand what's your problem?
But i will try my best.

Code:
char myval[] = "0800";
char inChar;
byte index = 0;

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  // First extract all the data
  while(Serial.available() > 0)
  {
    if(index < 4)
    {
      inChar = Serial.read();
      myval[index] = inChar;
      index++;
      Serial.println(index);
    }
  }
  ////////////////////////////
  //// Null terminator//////////
  myval[index] = '\0';

 ///THIS IS YOUR LOGIC AREA///
  if(index >= 4)
  {
    int nb1 = myval[0] - '0';
    int nb2 = myval[1] - '0';
    int nb3 = myval[2] - '0';
    int nb4 = myval[3] - '0';

    int result1;
    result1 = nb1*1000 + nb2*100 + nb3*10 + nb4;   // get minites     
    Serial.print("result1=");
    Serial.println(result1);
    delay(50);
    index = 0;
  }
}
44  Using Arduino / Programming Questions / Re: If statement not executing more than once "Serial.available();" on: April 03, 2013, 10:17:27 pm
thanks now i can rewrite every time y put a number but, its not the correct convertion,example:

before:
res=800
res=800
inserting by serial "0100"
res=25736
res=25736
inserting by serial "1000"
res=25736
res=25736

What kind of conversion?
45  Using Arduino / Programming Questions / Re: If statement not executing more than once "Serial.available();" on: April 03, 2013, 10:00:27 pm
Put this line at the start/end of function loop().

Code:
void loop()
{
index = 0;
.
.
.
}

It will intialize the index of array myval[zero].

Please always use the *insert code* option to insert code.
Pages: 1 2 [3] 4 5 ... 13