Show Posts
Pages: [1]
1  Using Arduino / Interfacing w/ Software on the Computer / Re: Interfacing Arduino w/ cpp on: February 17, 2011, 11:56:09 am
I'll study your code.
Thanks :D
2  Using Arduino / Interfacing w/ Software on the Computer / Interfacing Arduino w/ cpp on: February 09, 2011, 01:39:55 pm
Hi

I don't know how to make myself clear, but let's try it.
On the Arduino IDE, I've used an example (communication>graph), changed it a little, and uploaded to my Arduino. Then, I've used the FTDI app (d2xx) on Borland Builder C++ to do whatever I wanted.
But I had some problems, and I'd like to program some interrupts on C.
Can I do it just on software?

I know one guy who programmed in C on the USB port using a atmel8252 and this ftdi (ft232rl), but if I'd use his idea I'd have to sold some wires on my Arduino board and so... So my question is can I program everything on Arduino using C, C++?

Sorry for the bad English and thanks :)
3  Forum 2005-2010 (read only) / Interfacing / Re: buffer in serial comm on: November 05, 2010, 04:04:30 pm
Wow, thank you very much BKing smiley

I'll re-write my program here. ^^
4  Forum 2005-2010 (read only) / Interfacing / Re: buffer in serial comm on: November 05, 2010, 07:38:09 am
Whow! I want to store 100 bytes, I completely forgot this. So I'll store it on a string, not in a int.

But if I use the Serial.write function doesn't it send bytes?

Quote
write()
Description

Writes binary data to the serial port. This data is sent as a byte or series of bytes
5  Forum 2005-2010 (read only) / Interfacing / Re: buffer in serial comm on: November 05, 2010, 06:13:00 am
What I want to do is quite simple (but as you can see, I'm not getting much sucess).

I have a trimpot connected at the analogic 0, and I want to make a buffer with 100 data and send it on the serial comm.
6  Forum 2005-2010 (read only) / Interfacing / Re: buffer in serial comm on: November 05, 2010, 06:05:09 am
Am I? I only realize it now... I thought I was clearing the buffer hahah smiley-sad

As I couldn't use the command Serial.write(buf,len), I've made a loop to write on the serial comm, and I'm seeing my data on ASCII, is this suppose to happen?
7  Forum 2005-2010 (read only) / Interfacing / Re: buffer in serial comm on: November 05, 2010, 05:42:27 am
Yes, but I want only 100 elements...
8  Forum 2005-2010 (read only) / Interfacing / Re: buffer in serial comm on: November 05, 2010, 04:57:16 am
What do you mean by "buffer[100]" doesn't exist?

And if it's already in binary, what's the problem?
9  Forum 2005-2010 (read only) / Interfacing / Re: buffer in serial comm on: November 04, 2010, 02:58:01 pm
Hm I thought the data could be of any kind, and arduino would convert it to binary to write it... But if I have to do it myself, that's ok.

Thanks smiley
10  Forum 2005-2010 (read only) / Interfacing / Re: buffer in serial comm on: November 04, 2010, 02:42:51 pm
Yes, I did.

Description


"Writes binary data to the serial port. This data is sent as a byte or series of bytes; to send the characters representing the digits of a number use the print() function instead."

Syntax

Serial.write(buf, len)

Parameters

buf: an array to send as a series of bytes
len: the length of the buffer
11  Forum 2005-2010 (read only) / Interfacing / Re: buffer in serial comm on: November 04, 2010, 01:29:59 pm
I've used another loop and it works!! smiley-grin

But I was using the Serial.print function, and now I'm trying to use the Serial.write one, and it is not working anymore.
As I saw in the Arduino reference page, I use this command:
[glow]Serial.write(buf, len) [/glow]

So my code stay like this:

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

void loop() {
  int buffer[100], i, j;
i=0;
j=0;
buffer[100]=0;

  for (i=0; i<100; i++) {
      buffer[i]=analogRead(0);
  }

  Serial.write(buffer,100);
         delay(1000);  
}

Does anybody know why it didn't work?
12  Forum 2005-2010 (read only) / Interfacing / Re: buffer in serial comm on: October 25, 2010, 01:55:09 pm
Hmm got it! I'll try it here.
Thanks!! smiley
13  Forum 2005-2010 (read only) / Interfacing / Re: buffer in serial comm on: October 25, 2010, 01:50:23 pm
Yes, but I want to print the whole buffer smiley-sad
14  Forum 2005-2010 (read only) / Interfacing / Re: buffer in serial comm on: October 25, 2010, 01:46:56 pm
but if I put buf[0] won't arduino print only the first number?
15  Forum 2005-2010 (read only) / Interfacing / buffer in serial comm on: October 25, 2010, 01:08:14 pm
Hello smiley

I'm sending data from my Arduino to a program on Borland Builder C++ and graphing it. But there are some problems, and I want to send it on a buffer on Arduino.
There is something wrong with my code and I'm not being able to find where the problem is.
The code is below... As you can see, I create a vector called buffer, indicated as the analog read, and once is fulled (with 100 bytes), it's printed on screen. But all I can get it is the same numbers, always. No matter what I do with my potentiometer (which by the way is where I'm getting my data of) the numbers never change.

[glow]void setup() {
  Serial.begin(9600);
}

void loop() {
  int buf[100], i;
    
  for (i=0; i<100; i++) {
      buf=analogRead(A0);
  }
          Serial.print(buf);
        delay(1000);
}[/glow]

Thanks smiley
Pages: [1]