Show Posts
Pages: 1 [2] 3 4 5
16  Using Arduino / Networking, Protocols, and Devices / Re: Can the Uno handle two serial port functions ? on: April 09, 2013, 02:56:33 am
Thanks for the info...

The Leonardo might work for me if it has 2 serial ports as you say...

Does the Leonardo have the same footprint & pinout as the Uno?

From pictures that I have seen they look the same except for the USB connector
as the Leonardo has a mini, is this correct? 

What other differences are there between the Uno and Leonardo?
17  Using Arduino / Networking, Protocols, and Devices / Can the Uno handle two serial port functions ? on: April 08, 2013, 03:58:32 pm
I have an Ardunio Uno that I would like to connect the rxd (d0) and txd (d1) lines
to a serial device to send and receive data with that device.

I also want to echo data to the USB port to a PC to display the data in a Labview application.

Can the Uno handle these two serial port functions with d0/d1 and the USB port?

Thanks
18  Using Arduino / Networking, Protocols, and Devices / Re: Serial.print issues on: March 08, 2013, 04:19:20 am
I tweaked a few things and got it up to 735 at one point in the code
but then at other points of the code it doesn't work (must be running out of memory at those areas I assume..)

I notice no difference removing constants but arrays seem to eat up some sram.

What types of commands/ data structures tend to chew this sram up so fast and what
should I look to change to free up some of this sram?

thanks
19  Using Arduino / Networking, Protocols, and Devices / Re: Serial.print issues on: March 07, 2013, 02:17:49 pm
Thanks Surfer Tim-

I tried this on my Uno code and it reads
Free SRAM = -1248

Does this mean I have 1248 bytes left?

20  Using Arduino / Networking, Protocols, and Devices / Re: Serial.print issues on: March 07, 2013, 01:35:05 pm
Is there a way to tell how much sram is being used when code is uploaded to an arduino?
21  Using Arduino / Networking, Protocols, and Devices / Re: Serial.print issues on: March 07, 2013, 12:55:11 pm
Thanks - Yes it is a uno...

I slapped this together to show what I was seeing with the code that I am using as
it may be to lengthy to post.

In that code I am using a 8 x 22 buffer but find that it is doing the same thing (running out of Sram)

What else uses Sram, is it constants, variable, and the code too? Also, any tips on things to do to compact
the Sram use? I would like to consider this before upgrading the hardware if possible.

thanks again
22  Using Arduino / Networking, Protocols, and Devices / Serial.print issues on: March 07, 2013, 12:27:49 pm
I am seeing something peculiar with Serial.print and am wondering if it is some sort
of buffer overrun' framing error or what...

Here is a simplified version of my code that exhibits the same symptom:
Code:
int bufferMatrix[50][50];
int xpos, ypos;

void setup()
{
  Serial.begin(9600);
  Serial.println("****  Setup is done *****  ");
}

void loop()
{
  Serial.println("****  loop has started *****  ");

   for (ypos = 0; ypos < 50; ypos++)
   { 
      for (xpos = 0; xpos < 50; xpos++)
      { 
//         bufferMatrix[xpos][ypos] = 0;
      }
   }
}
 

Here is the output from the code above:
Quote
****  Setup is done ***** 
****  loop has started ***** 
****  loop has started ***** 
****  loop has started ***** 
****  loop has started ***** 
****  loop has started ***** 
****  loop has started ***** 
****  loop has started ***** 
****  loop has started *****

If I remove the comment from the line:

//         bufferMatrix[xpos][ypos] = 0;

then I get no output from my Serial.print statements.
Why is that and how can I fix this?


Thanks
23  Using Arduino / Programming Questions / Re: Is there another way to do a DigitalWrite? on: February 26, 2013, 03:03:42 pm
Thanks Lefty.

Your answer definitely helped out.

This chip only has a PortB, PortC, & PortD.
24  Using Arduino / Programming Questions / Re: Is there another way to do a DigitalWrite? on: February 26, 2013, 02:01:21 pm
I have another bit of code that is getting a compile error on the following line:

        PORTA = (PORTA ^ B00000001);

with a 'PORTA' was not declared in  this scope ' error.

I am using an atmel chip with the Uno bootloader and if I change the board type to a mega, it compiles without error.

How can I set this up to load on my Uno without an error?

thanks
25  Using Arduino / Programming Questions / Re: Problems with Wire.requestFrom (Arduiono Uno v1.0.3) on: January 30, 2013, 09:26:55 am
And, you've been told that it is I2C, not I2c. Don't come back until you fix that.

Fix I2c Again???
Wasn't the problem... I2c is correct and as I posted prior to your reply,  that is the way that is was in the sample code that came with the library.

 I later found out (thanks to Nick's post) that the sample code did not work for me because I hadn't restarted the IDE and loaded the library...

but thanks all the same...
26  Using Arduino / Programming Questions / Re: Problems with Wire.requestFrom (Arduiono Uno v1.0.3) on: January 30, 2013, 09:17:18 am
Did you restart the IDE after installing the library? Did you install the library?

Thanks Nick!

I thought that I did restart the IDE but I had another instance of it running in the background.

I closed all instances of the IDE and then stated up one instance of it and then I was able to import the library.

I like your scan utility and would like to incorporate that into checking for the device
before reading it but not sure how to convert it over to the I2C.h library functions for the following:

    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)


27  Using Arduino / Programming Questions / Re: Problems with Wire.requestFrom (Arduiono Uno v1.0.3) on: January 29, 2013, 04:19:09 pm
Where did you store the files and did you need to do anything else to link the I2C.h file?

I keep getting this 'I2c' was not declared in this scope error
on the  I2c.begin()  line of code

28  Using Arduino / Programming Questions / Re: Problems with Wire.requestFrom (Arduiono Uno v1.0.3) on: January 29, 2013, 02:53:45 pm
I would still be using Wire.h also if it wasn't locking up my sketch...
29  Using Arduino / Programming Questions / Re: Problems with Wire.requestFrom (Arduiono Uno v1.0.3) on: January 29, 2013, 01:58:17 pm
Thanks...
I tried changing the case the I2c.begin() to I2C.begin() and the error for the same line of code
changes to request for member 'begin' in 'I2C', which is of non-class 'int'


What gives?

I copied the sample code that was on the library link page and it does the same thing:
/*******************************************
 Sample sketch that configures an HMC5883L 3 axis
 magnetometer to continuous mode and reads back
 the three axis of data.
 Code compiles to a size of 1500 bytes
 Equivalent Wire Library code compiles to 2032 bytes
 *******************************************/

Code:
#include <I2C.h>

#define HMC5883L  0x1E

int x = 0;
int y = 0;
int z = 0;


void setup()
{
  I2c.begin();
  I2c.write(HMC5883L,0x02,0x00); //configure device for continuous mode
}

void loop()
{
  I2c.read(HMC5883L,0x03,6); //read 6 bytes (x,y,z) from the device
  x = I2c.receive() << 8;
  x |= I2c.receive();
  y = I2c.receive() << 8;
  y |= I2c.receive();
  z = I2c.receive() << 8;
  z |= I2c.receive();
}
 
30  Using Arduino / Programming Questions / Re: Problems with Wire.requestFrom (Arduiono Uno v1.0.3) on: January 29, 2013, 12:54:53 pm
Thanks for the link.

I am attempting to switch my code over to use this I2c.h library but I keep getting an error with the following:

  I2c.begin();   gives me this error:    'I2c' was not declared in this scope

in my code I have included the file included:
#include <I2C.h> and in both the v1.0.3 IDE and v1.0.1  IDE
I have also tried adding I2c.h & I2c.cpp but still I get this error.

This was done after I placed I2C folders (which contain I2c.h & I2c.cpp) into  \my documents\Aduino-1.0.1\libraries
 and \my documents\Aduino-1.0.3\libraries folders.

I see an import library option in the sketch pull down menu but the I2c library does not exist in the list nad there does not appear to be a way to browse for it either...

Any ideas what i am missing or doing wrong?

thanks
Pages: 1 [2] 3 4 5