Show Posts
|
|
Pages: [1]
|
|
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 :)
|
|
|
|
|
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? write() Description
Writes binary data to the serial port. This data is sent as a byte or series of bytes
|
|
|
|
|
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  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?
|
|
|
|
|
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!!  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: 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?
|
|
|
|
|
15
|
Forum 2005-2010 (read only) / Interfacing / buffer in serial comm
|
on: October 25, 2010, 01:08:14 pm
|
Hello  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 
|
|
|
|
|