Pages: [1] 2   Go Down
Author Topic: PROCESSING + ARDUINO  (Read 1666 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone,
can you guide for me the way to create 2 line segments (joint together) on processing.
Each segment simulate for 1 sensor as the figure below.
thanks!


* rtjh.JPG (30.09 KB, 484x264 - viewed 50 times.)
« Last Edit: April 15, 2014, 09:22:04 am by ariesking » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
can you guide for me the way to create 2 line segments (joint together) .
I don't think the Arduino is capable of creating line segments. Processing has it's own forum (and a shitload of examples).
Logged

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

Quote
can you guide for me the way to create 2 line segments (joint together) .
I don't think the Arduino is capable of creating line segments. Processing has it's own forum (and a shitload of examples).
i also ask on processing forrum but i see they don't have enthusiasm as arduino forum.
i thinh arduino and processing be alway together in transfer data  to diisplay and in this forum: someone will have many experience about processing.
So, i decide ask in this forum.
hope that someone can help me.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
hope that someone can help me.
Where is your code, and what have you tried? Drawing a line is trivial.
Logged

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

 
Quote
Where is your code, and what have you tried? Drawing a line is trivial.
i haven't writen code because i don't know how to draw it.
i wanna send data from sensor to '' segment'' on processing to simulate it as figure i attach .
could you guide for me?


* rtjh.JPG (30.09 KB, 484x264 - viewed 26 times.)
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i haven't writen code because i don't know how to draw it.
Code:
    line(x1, y1, x2, y2);
All you need to do is supply values for x1, y1, x2 and y2.

Quote
i wanna send data from sensor
What sensor?

Logged

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

i wanna joint 2 lines, not 1 line.
each line is (GY -521 + GY271)
« Last Edit: March 29, 2014, 12:43:44 pm by ariesking » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i wanna joint 2 lines, not 1 line.
So, go right ahead. Call the function twice.
Logged

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

i don'n understand.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Put this in draw() and see what it does.
Code:
int x1=0;
int y1 = 0;

int x2 = 2;
int y2 = 2;

int x3 = 5;
int y3 = 2;

line(x1, y1, x2, y2);
line(x2, y2, x3, y3);
Two calls to line()!
Logged

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

Put this in draw() and see what it does.
Code:
int x1=0;
int y1 = 0;

int x2 = 2;
int y2 = 2;

int x3 = 5;
int y3 = 2;

line(x1, y1, x2, y2);
line(x2, y2, x3, y3);
Two calls to line()!
I don't know how to send data ( euler angle) from arduino to sengment on processing.
please tell me.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I don't know how to send data ( euler angle) from arduino to sengment on processing.
Then this project is not for you.
Logged

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

After i can read the pitch, roll, yaw from arduino code
i try  to run processing code :
 
But it have some mistake:
Quote
error, disabling serialEvent() for //./COM4
java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at processing.serial.Serial.serialEvent(Unknown Source)
   at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732)
   at gnu.io.RXTXPort.eventLoop(Native Method)
   at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
   at ds.serialEvent(ds.java:105)
   ... 8 more
Could you guide me to repair it?
« Last Edit: April 22, 2014, 03:50:23 am by ariesking » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
float stringKalmanX, stringKalmanY,stringKalmanZ;
This was as far as I read. If the variable IS a float, get rid of string from the name. These names look stupid, which reflects on you!

Code:
   println(Serial.list()); // Use this to print connected serial devices
What did this show? Is your Arduino really connected to the second port in the list?
Logged

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

Quote
Code:
float stringKalmanX, stringKalmanY,stringKalmanZ;
This was as far as I read. If the variable IS a float, get rid of string from the name. These names look stupid, which reflects on you!
It is a variable name, so it doesn't effect.. When it is: String stringKalmanX, stringKalmanY,stringKalmanZ;>>> error>> so, i change it to float but i forgot change the name of it from stringkalman to  kalman

Quote

Code:
  println(Serial.list()); // Use this to print connected serial devices
What did this show? Is your Arduino really connected to the second port in the list?
here is code to draw a plane but it shows a black table.
i'm sure it is connected to COM which i setup.
« Last Edit: April 16, 2014, 01:36:02 am by ariesking » Logged

Pages: [1] 2   Go Up
Jump to: