Go Down

Topic: PROCESSING + ARDUINO (Read 2972 times) previous topic - next topic

ariesking

Mar 29, 2014, 05:36 pm Last Edit: Apr 15, 2014, 04:22 pm by ariesking Reason: 1
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!

PaulS

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).

ariesking


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.

PaulS

Quote
hope that someone can help me.

Where is your code, and what have you tried? Drawing a line is trivial.

ariesking

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?

PaulS

Quote
i haven't writen code because i don't know how to draw it.

Code: [Select]
    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?


ariesking

#6
Mar 29, 2014, 06:40 pm Last Edit: Mar 29, 2014, 06:43 pm by ariesking Reason: 1
i wanna joint 2 lines, not 1 line.
each line is (GY -521 + GY271)

PaulS

Quote
i wanna joint 2 lines, not 1 line.

So, go right ahead. Call the function twice.


PaulS

Put this in draw() and see what it does.
Code: [Select]
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()!

ariesking


Put this in draw() and see what it does.
Code: [Select]
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.

PaulS

Quote
I don't know how to send data ( euler angle) from arduino to sengment on processing.

Then this project is not for you.

ariesking

#12
Apr 15, 2014, 04:20 pm Last Edit: Apr 22, 2014, 10:50 am by ariesking Reason: 1
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?

PaulS

Code: [Select]
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: [Select]
   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?

ariesking

#14
Apr 16, 2014, 06:38 am Last Edit: Apr 16, 2014, 08:36 am by ariesking Reason: 1
Quote
Code: [Select]
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: [Select]
  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.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy