Pages: [1]   Go Down
Author Topic: cyclical usb-bulk transfer  (Read 101 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hallo,

my name is george and i am new to arduino. i have some question about programming on my ardunio uno r3 board.

i'm trying to implement a bidirectional cyclical usb-bulk transfer, where a certain process image is exchanged between my arduino board and a normal win7 personal computer.

looking at the arduino software, i only found HID examples - is it possible, to do a bulk transfer as described above?


regards,
george

Logged

BCC AZ USA
Offline Offline
God Member
*****
Karma: 21
Posts: 930
It gets hot so it must be working
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can do serial communication using USB.  I have used Processing to send data to and receive from  a Uno.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

some code examples would help me a lot. are there any available?
Logged

BCC AZ USA
Offline Offline
God Member
*****
Karma: 21
Posts: 930
It gets hot so it must be working
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This processing code reads, from the serial port, 4 float values from 3 accelerometers and  a compass and splits out the readings in(x,y,z,heading) to an array.  The data is delimited by spaces and ends with a linefeed.  ex. 3.121 4.333 1.247 240.0 Sent from Uno by Serial.print(x); Serial.print(" ");...Serial.println(heading);

Code:
void getAccel() {
  while (myPort.available () == 0);
  while (myPort.available () > 0) {  // If data is available,
    myString = myPort.readStringUntil(lf);
  }
  if (myString != null) {
    output.print(myString);
    str = split(myString, ' ');
    for (int n=1; n<7; n++) {
      accel[n] = float(str[n]);
    }
    for (int n=1; n<7; n++) {
      println(accel[n]);
    }
  }
}
Logged

Pages: [1]   Go Up
Jump to: