Show Posts
Pages: [1] 2
1  Using Arduino / Programming Questions / Re: Arduino uno not printing messages in setup() on: February 12, 2013, 02:49:29 pm
This isn't your whole code. What is the value of NUMBER_OF_BODIES?

You might be running out of RAM, you may want to store the strings in flash.

Yes I have told you that this is now my whole code. It is just the new variables I added.

What do you mean in flash? Can you give me any example of this?

How much memory does arduino have?
2  Using Arduino / Programming Questions / Arduino uno not printing messages in setup() on: February 12, 2013, 02:34:49 pm
Hello,

my program was working normally until yesterday. Then I add some arrays in the program, changed nothing in the setup but I cannot even see the messages in setup.

Here are what I added, and my setup function which is the same as before:

Code:
char* responses_array[]={
  "80","81","82"};

char* alive_array[]={
  "75","76","77"};

char* responses_to_wait[NUMBER_OF_BODIES];
char* alive_to_wait[NUMBER_OF_BODIES];

int positions[NUMBER_OF_BODIES];

int bodies_to_send_to[NUMBER_OF_BODIES];

void setup()
{
  Serial.begin(57600);

  Serial.println( "Arduino started sending bytes via XBee Vol.2" );

  // set the data rate for the SoftwareSerial port
  xbee.begin(9600);

  lcd.begin(16,2);              // columns, rows.  use 16,2 for a 16x2 LCD, etc.
  lcd.clear();                  // start with a blank screen
  lcd.setCursor(0,0);           // set cursor to column 0, row 0 (the first row)
  lcd.print(upRow);    // change this text to whatever you like. keep it clean.
  lcd.setCursor(0,1);           // set cursor to column 0, row 1
  lcd.print(bottomRow);

  for(int i=0;i<NUMBER_OF_BODIES;i++){
    positions[i]=0;
    Serial.print("Setting position at 0:  ");
    Serial.print(i);
  }
  Serial.println(" ");
  
}


 in the Serial I see something like this:

Code:
¬Hø¬Hø¬Hø¬Hø¬Hø¬HøÔ
Ô
Ô
Ô
Ô
Ô
Ô
Ô
Ô
Ô
Ô
Ô
Ô
Ô
Ô
Ô
Ô
Ô
¬Hø¬Hø¬Hø¬Hø¬Hø¬HøÔ
Ô
¬Hø¬Hø¬Hø¬HøÔ
Ô
Ô
Ô
Ô
¬Hø¬Hø¬Hø¬Hø¬Hø¬HøÔ
Ô
Ô
Ô
Ô
Ô
Ô
Ô
Ô
Ô
Ô
Ô
Ô
Ô
Ô
Ô
Ô
Ô
¬Hø¬Hø¬Hø¬Hø¬Hø¬HøÔ

I have tried with two different arduino UNO, and cables but still nothing.

When I upload the program, TX and RX blink at the same time, and then TX blinks so fast.

As I remember before, TX was not blinking that fast.

If I run the last code, it runs without any problem.
3  Using Arduino / Displays / Re: LCD keypad connected to arduino, not showing on screen. on: January 29, 2013, 10:32:09 am
1) I do not want to connect it on top of my arduino but with wires. This is because I want to have some switches in my arduino so I do not know where to connect them If I connect that on top.

Since you have the LCD shield already, you might as well use it as a shield, and there are two obvious options.

1.  Connect your extra switches to the unused pins on the shield. The connection points are provided on the board for that purpose, the most obvious ones are A1 to A5 but D1 to D3 are likely candidates as well.

2. Have a prototype shied between the LCD and Arduino. This can take your switch connections etc., and provide mounts for items like a clock.

Quote
So using this diagram http://www.shieldlist.org/dfrobot/lcd I conneected the bolds pins into the arduino equivalent pins. Plus I connected the GND,VIN,5V,3.3V of arduino to the lcd keypad.

But even if I run the example and I can identify button presses (not so accurate though) I see nothing on screen.

Should I connect them all?

2) I want to have a switch in arduino digital pin 11, so if i connect them all, where is that pin going to connect? And still a digital.read fro pin 11 will be enough?

I don't understand the problem. You obviously need to connect all the pins in order to do the job. If you have done that correctly and see nothing, it might simply be a matter of adjusting the contrast. Your board looks the same as mine, uses the same pins, and my buttons are on A0. If you must connect a switch to pin 11, which is not likely and probably a bad habit, then the proto board is a solution. I think a better solution is to put the switch on pin 3 instead.



The pin 3 is actually used for a software serial, as I am also having an xbee. Do you think it's gone be a problem without the protoshield? I connected the rest, adjusted the contrast and now it playes normally:)
4  Using Arduino / Displays / LCD keypad connected to arduino, not showing on screen. on: January 25, 2013, 06:15:42 pm
Hello,

I am using this LCD keypad : http://www.dfrobot.com/wiki/index.php?title=Arduino_LCD_KeyPad_Shield_%28SKU:_DFR0009%29

I am trying the second example, with the LiquidCrystal library.

My questions are the following:

1) I do not want to connect it on top of my arduino but with wires. This is because I want to have some switches in my arduino so I do not know where to connect them If I connect that on top.
So using this diagram http://www.shieldlist.org/dfrobot/lcd I conneected the bolds pins into the arduino equivalent pins. Plus I connected the GND,VIN,5V,3.3V of arduino to the lcd keypad.

But even if I run the example and I can identify button presses (not so accurate though) I see nothing on screen.

Should I connect them all?

2) I want to have a switch in arduino digital pin 11, so if i connect them all, where is that pin going to connect? And still a digital.read fro pin 11 will be enough?
Thanks!
5  Using Arduino / LEDs and Multiplexing / Re: DigitalRead always gets me HIGH on: January 20, 2013, 12:59:45 pm
You can not leave a pin unconnected, you need a pull up or pull down.
Please read:-
http://www.thebox.myzen.co.uk/Tutorial/Inputs.html
Thanks man! That was it!
6  Using Arduino / LEDs and Multiplexing / DigitalRead always gets me HIGH on: January 20, 2013, 12:34:17 pm
Hello I am using this simple code that I have used so many times before:

Code:
const int buttonSwitchA=9;

void setup()
{
 Serial.begin (57600);
 pinMode(buttonSwitchA, INPUT);
}

void loop()
{
  buttonStateA=digitalRead(buttonSwitchA);
  if (buttonStateA==HIGH) {
    Serial.println("printing");
    delay(1000);
  }
}

I have a switch in my breadboard. One pin is in the 5V and the other is my "free" pin. My switch works fine because I checked with  using a voltometer, when i press the switch and measured voltage the free pin. (basiccally i do not know how to explain this but I used that mode when there is path, you hear the beep sound. When switch is pressed sound is heard, otherwise not).

So my switch works.

When i plug in the free pin in the arduino input 9, it always read HIGH and prints the message. I tried wit other inputs but still nothing.

Is it a problem of code or what should I checked?
7  Using Arduino / Networking, Protocols, and Devices / Re: xbee receives but not send back data on: January 10, 2013, 08:18:49 am
Quote
Do I set all of the three to be end-devices or FRED must be co-ordinator?
End device and coordinator are series 2 terms. Are you SURE you have, and are configuring, series 1 models?

yes sure. those terms where not visible in the X-CTU but I found them on a tutorial. Anyway since there is nothing else to configure either my connection are wrong or my XBee's stopeed working. I will check it out again since now I do not see any communication at all (not even the one I said in the first post that FRED could send to anyone but not was not able to read back).
8  Using Arduino / Networking, Protocols, and Devices / Re: xbee receives but not send back data on: January 10, 2013, 05:09:08 am
Quote
1)So the correct configuration for this example is:

FRED: PAN ID:3128, MY=8001, DL=4382
SUE: PAN ID: 3128, MY=4382, DL= 8001?
Yes. Or any values, as long as PAN ID is the same on both and MY on one is DL on the other.

Quote
And a little more on that since in the future I would like to expand it with ore:

I have FRED, SUE, NICK. I want Fred to send to everyone, and Sue and Nick to send back only to Fred.
The FRED needs a MY value that SUE and NICK use as the DL value. SUE's and NICK's MY address doesn't matter. FRED's DL address will be 0xFFFF - the broadcast address.

I don't think that using 0 as MY or DL on any of the XBees is a good idea.

it does not seem to work. Do I set all of the three to be end-devices or FRED must be co-ordinator? Does it make any difference?
9  Using Arduino / Networking, Protocols, and Devices / Re: xbee receives but not send back data on: January 09, 2013, 07:23:58 pm
Thanks for answering all of my questions.

I will try them.
10  Using Arduino / Networking, Protocols, and Devices / Re: xbee receives but not send back data on: January 09, 2013, 01:10:31 pm
1)So the correct configuration for this example is:

FRED: PAN ID:3128, MY=8001, DL=4382
SUE: PAN ID: 3128, MY=4382, DL= 8001?

And a little more on that since in the future I would like to expand it with ore:

I have FRED, SUE, NICK. I want Fred to send to everyone, and Sue and Nick to send back only to Fred.

2) I read somewhere that if you want the sending data to be received from all the XBee's with the same PAN ID, then DL and MY must be set to 0. So I left them to 0, and then whatever I send from from Fred can be read from every XBee, and whatever I send from Sue is not read by anyone? So what I did is something like:

(in pseudocode)

Code:
//fred code
 send("s"); or send("n");
...

//receiver code
if read=="s" then code for sue
else if read="n" code for nick.

And in the code for sue I have send("result"). But this is not send.

What configuration do I need?
11  Using Arduino / Networking, Protocols, and Devices / xbee receives but not send back data on: January 09, 2013, 10:51:08 am
Hello,

i am trying to build a communication between 2 xbees. I am able to send from the one to another but now I want to send back to the other xbee.

Here is my receiver code:

Code:
void loop()  {
 if (xbee.available() > 0) {
    int char_read=xbee.read();
    if (char_read==65) {
          xbee.println('P');
          Serial.print("Character A received: ");
    } else {
      Serial.println("Waiting");
    }
 } else {
    Serial.println("Not available data");
 }
 delay(1000);
}

So I want when receiving 'A' to send back 'P'. I am getting 'A' since I see the message "character a received" but message is not sent back because i n my sender side always the reading value is -1.

It is like they cannot do at the same time both operations.

I am using XBee series 1.
12  Using Arduino / Networking, Protocols, and Devices / Re: sending data between 2 arduinos using xbee on: January 08, 2013, 03:13:53 pm
Quote
DL is the destination Low bits right?
Yes.

Quote
Can you help me on what is MY?
Have you even fired up X-CTU?

Yes I had. But so far I had configured DL,DH, and PAN ID. And I told you through FTDI it plays.

 So can you help me on that? What MY stands for?
13  Using Arduino / Networking, Protocols, and Devices / Re: sending data between 2 arduinos using xbee on: January 08, 2013, 09:31:39 am
Can you help me on what is MY? DL is the destination Low bits right?
14  Using Arduino / Networking, Protocols, and Devices / Re: serial data transfer between arduino uno and arduino micro on: January 08, 2013, 08:13:14 am
i connected to the pins 0-Tx, 1-Rx as shown in http://www.google.gr/imgres?imgurl=http://arduino.cc/en/uploads/Main/ArduinoMicro_pinout.png&imgrefurl=http://arduino.cc/en/Main/ArduinoBoardMicro&h=322&w=256&sz=39&tbnid=YaVYHo0WmFot9M:&tbnh=91&tbnw=72&zoom=1&usg=__8PNYmRdmUIQeCZqXA7yTceWVOag=&docid=JjYvdDtLKAQbDM&sa=X&ei=8RrsUO3xGu3M0AWD1YH4Aw&ved=0CDIQ9QEwAA&dur=765

What do you mean by Serial1? In my code i should
Code:
replace Serial.read() with Serial1.read()?
15  Using Arduino / Networking, Protocols, and Devices / Re: serial data transfer between arduino uno and arduino micro on: January 08, 2013, 04:50:52 am
Then I'm out of ideas. Software looks pretty basic and OK.

Lefty


Try it with two Arduino Uno and it works. Does it mean that my micro is problematic or I missed something about micro that I should do?
Pages: [1] 2