Show Posts
Pages: [1] 2
1  International / Deutsch / Re: Kann man ".jar"-Dateien in das Ethernet Shield Interface mit beinziehen? on: April 15, 2011, 04:06:50 am
Sorry für die späte Antwort,

war ne Woche lang im Urlaub.

Ok, das heißt, wenn ich auch mehrere .jar dateien habe ("net.jar", "core.jar") , den processing ordner aller dateien füge ich auch einfach in die "raumuberwachung.jar" ein und lad das dann hoch?
2  Using Arduino / Interfacing w/ Software on the Computer / Re: Eclipse and Ethernet Shield on: April 08, 2011, 07:47:46 am
Sorry for Double-Posting.


Can I assume that there is no way to use Eclipse and the Ethernet Shield?
3  International / Deutsch / Re: Kann man ".jar"-Dateien in das Ethernet Shield Interface mit beinziehen? on: April 07, 2011, 03:37:42 am
Hi,

danke für deine Antwort smiley

Irgendwie sind da jetzt noch mehr Fehlermeldungen.

Quote
Java Plug-in 1.6.0_24
Using JRE version 1.6.0_24-b07 Java HotSpot(TM) Client VM
User home directory = /home/gu74naz
----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
l:   dump classloader list
m:   print memory usage
o:   trigger logging
q:   hide console
r:   reload policy configuration
s:   dump system and deployment properties
t:   dump thread list
v:   dump thread stack
x:   clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
java.lang.ClassFormatError: Incompatible magic value 1013478509 in class file processing/core/PApplet
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
   at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:247)
   at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:250)
   at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:180)
   at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:161)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:217)
   at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at sun.plugin2.applet.Plugin2ClassLoader.defineClassHelper(Plugin2ClassLoader.java:1014)
   at sun.plugin2.applet.Plugin2ClassLoader.access$100(Plugin2ClassLoader.java:69)
   at sun.plugin2.applet.Plugin2ClassLoader$2.run(Plugin2ClassLoader.java:991)
   at java.security.AccessController.doPrivileged(Native Method)
   at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Plugin2ClassLoader.java:955)
   at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:134)
   at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:250)
   at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:180)
   at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:161)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
   at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Plugin2ClassLoader.java:675)
   at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3025)
   at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1498)
   at java.lang.Thread.run(Thread.java:662)
Exception: java.lang.ClassFormatError: Incompatible magic value 1013478509 in class file processing/core/PApplet


Ich hab den Codeteil nun so geschrieben:

Code:
   client.print("<applet code = 'sketch_apr04a.class' archive = 'sketch_apr04a.jar' width = '200' height = '100'> alt = 'mein applet'");
   client.print("<param name = 'archive' value = 'http://download1190.mediafire.com/6twnc1t33wqg/luj35z7v8dyp5bk/sketch_apr04a.jar' />");
   client.println("</applet>");

und die core.jar Datei hab ich in den Sketchbook-Ordner des Arduino Codes hineinkopiert sowie die sketch-apr04a.jar Datei.

Ich hab in dem Ordner also nur "core.jar" , "sketch-apr04a.jar" und "Test_Netzwerk_jar.pde" (Das Projekt heißt so).

Fehlt da noch was?


Liebe Grüße,

HammerH
4  Using Arduino / Interfacing w/ Software on the Computer / Re: Arduino DueMileNove, Eclipse, Ubuntu 10.04 on: April 06, 2011, 09:47:15 am
it works fine with the Arduino IDE, just troubles me with Eclipse smiley-sad

I'll look into what you have done and let you know how far I've come.

But have fun with Eclipse and Arduino smiley It's much more comfortable to write in Eclipse as in the Arduino IDE
5  International / Deutsch / Re: Kann man ".jar"-Dateien in das Ethernet Shield Interface mit beinziehen? on: April 06, 2011, 04:19:35 am
Danke für die Antwort.

Ich hab aber nur Sun Java 1.6 drauf, deswegen kann es ja nicht an verschiedenen Versionen liegen?
Kann es sein, dass ich im Code selber etwas falsch eingegeben habe?
Kann man überhaupt eine jar Datei lokal einbinden? Ich hab da ja das Verzeichnis eingegeben im codebase - Teil. Ist das genug?


Liebe Grüße,

HammerH
6  Using Arduino / Interfacing w/ Software on the Computer / Re: Arduino DueMileNove, Eclipse, Ubuntu 10.04 on: April 06, 2011, 03:13:25 am
I would have needed this a month ago ^^ but thanks anyway. but do you have some notes about how to use the Ethernet Shield with Eclipse?
7  International / Deutsch / Kann man ".jar"-Dateien in das Ethernet Shield Interface mit beinziehen? on: April 05, 2011, 08:50:37 am
Hallo,

ich wollte wissen, ob jemand weiß, ob man die per Processing erstellten .jar- Dateien in das Interface vom Ethernet Shield einfügen kann. Das Interface wird ja in HTML geschrieben, und das kann ja .jar-Dateien einbinden.

Geht das aber auch wenn ich dieses "html" in C schreibe?

Ich hab hier mal folgenden Codeabschnitt:


Code:
   client.println("<applet codebase = '/home/gu74naz/sketchbook/Test_Netzwerk_jar' archive = 'sketch_apr05a.jar' code = 'sketch_apr05a.class' width = '500' height = '500'></applet>");   
   client.println("</body></html>");

Wenn ich im Browser die IP des Shields eingebe, ist da der Platz für die jar datei reserviert aber mit nem Error. folgende Fehlermeldung erhalte ich :


Quote
Java Plug-in 1.6.0_24
Using JRE version 1.6.0_24-b07 Java HotSpot(TM) Client VM
User home directory = /home/gu74naz
----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
l:   dump classloader list
m:   print memory usage
o:   trigger logging
q:   hide console
r:   reload policy configuration
s:   dump system and deployment properties
t:   dump thread list
v:   dump thread stack
x:   clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------


java.lang.ClassFormatError: Incompatible magic value 1013478509 in class file sketch_apr05a
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
   at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:247)
   at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:250)
   at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:180)
   at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:161)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
   at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Plugin2ClassLoader.java:675)
   at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3025)
   at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1498)
   at java.lang.Thread.run(Thread.java:662)
Exception: java.lang.ClassFormatError: Incompatible magic value 1013478509 in class file sketch_apr05a


Kann da jemand helfen oder hat schon mal was ähnliches ausprobiert?


Liebe Grüße,

HammerH
8  Using Arduino / Interfacing w/ Software on the Computer / Eclipse and Ethernet Shield on: April 04, 2011, 05:09:51 am
Hi,

can someone tell me how to configure Eclipse so that I can use the Ethernet.h library?

I copied the intend of the folder ETHERNET in the libraries folder of the Arduino IDE into the project, but this doesn't work and I don't find anything in the Internet.

I hope somebody can help me.

Best Regards,

HammerH
9  Using Arduino / Interfacing w/ Software on the Computer / Re: Processing Seriel communication Question on: March 28, 2011, 05:37:09 am
Do I need Serial.print?

I used it to control the Slider values, which were 1023 if in highest position but otherwise I don't know why I should use it?

Now i use the string, because i want to send more values to processing and this is the easiest way I know so far.

10  Using Arduino / Interfacing w/ Software on the Computer / Re: Processing Seriel communication Question on: March 28, 2011, 04:09:25 am
I have now modified the code so that my arduino sends a string and processing receives it and splits it into smaller strings :

Arduino:
Code:
slider1 = analogRead(A0);
int slider2 = analogRead(A1);
sprintf(ascii,"A%04d,%04dE", slider1, slider2);
Serial.write(ascii);


Processing:

Code:
if(port.available()>0)
 {
String inBuffer = port.readString();
if(inBuffer!=null)
{
int posA = inBuffer.indexOf("A");
temp = inBuffer.substring(posA+1);
int posE = temp.indexOf("E");
if(posE>=0)
{
temp= temp.substring(0,posE);
values = split(temp,",");
                 }

this works well but now i have the problem that my DangerShield is much slower acting to the port.writes of processing and the 7-segment led is blinking all the time and doesn't show the numbers properly...
11  Using Arduino / Interfacing w/ Software on the Computer / Re: Processing Seriel communication Question on: March 28, 2011, 03:08:51 am
Ok. I have to program the use of the DangerShield of ZachHoeken. The Images are just pictures of the DangerShield and some Leds on and so on.

I want to read the value of the first Slider. At first it didn't want to work, now Processing prints me the only the first value all the time and even though the slider is at its fullest position (has a value of 1023) it only sends 255 ...


Here is the processing Code: (by the way, I'm writing code with Eclipse, so don't wonder because of some differences smiley )


Code:
public class DangerShield extends PApplet {

//import class to set up serial connection with wiring board


Serial port;
String test;
PImage Shield;
PImage[] LED1= new PImage[2];
int ld1 = 0;
PImage[] LED2=new PImage[2];
int ld2 = 0;
PImage[] SegLED = new PImage[10];
int i = 0;
int j = 0;
int[] stand = {0,0,0,0,0,0,0};
public void setup()
{
background(255);
Shield=loadImage("DShield.jpg");
LED1[0]=loadImage("LED1aus.png");
LED1[1]=loadImage("LED1an.png");
LED2[0]=loadImage("LED2aus.png");
LED2[1]=loadImage("LED2an.png");
for(int j = 0; j<10;j++)
SegLED[j]=loadImage(""+j+".png");
size(900,375);
println(Serial.list());
port = new Serial(this,Serial.list()[0],9600);
image(Shield,200,0);
}

int slider1 = 0;
public void draw()
{

fLED1();
fLED2();
fSegLed();
portwrite();
if(port.available()>0)
 {
slider1 = port.read();
println(slider1);
 }

 

//println("Mausx: " + mouseX + "\tMausy: "+mouseY);
fill(255);
rect(0,0,200,375);
rect(700,0,200,375);
texte();

}



public void fLED1() //Koordinaten: X von 558-580; Y von 163-191
{

boolean over = false;
if(mouseX>=558 && mouseX<=580 && mouseY>=162 && mouseY <=191)
over = true;
//println(over);
if(over==true )
{
i = 1;
image(LED1[stand[i]],555,160); // turns LED on
ld1 = stand[i];
}
}
public void fLED2() //Koordinaten: X von 550-576; Y von 134-167
{

boolean over = false;
if(mouseX>=550 && mouseX<=576 && mouseY>=134 && mouseY <=162)
over = true;
//print(over);
if(over==true )
{
i = 2;
image(LED2[stand[i]],553,133);  //turns LED on
ld2 = stand[i];
}

}
public void fSegLed() //7 Segment-LED
{
boolean over1 = false; // Maus über Button1 X: 380-401 Y:250-270
boolean over2 = false; // Maus über Button2 X: 446-467 Y:250-270
boolean over3 = false; // Maus über Button3 X: 508-531 Y:250-270

if(mouseX>=380 && mouseX<=401 && mouseY >=250 && mouseY <=270)
{
over1 = true;
i = 3;
if(mousePressed)
{
delay(150);
j++;
}

if(j>9)
j = 0;
}
if(mouseX>=446 && mouseX <= 467 && mouseY >=250 && mouseY <=270)
{
over2 = true;
i = 3;
if(mousePressed)
{
delay(150);
j--;
}
if(j<0)
{
j=9;
}
}
image(SegLED[j],301,212);

}
public void portwrite()
{
if(ld1 == 1)
port.write('A');
if(ld1 == 0)
port.write('B');
if(ld2 == 1)
port.write('C');
if(ld2 == 0)
port.write('D');
port.write(j);
}
public void texte()
{
fill(0);
line(110,20,110,355);
text("Wert von Slider1:",2,60);
}
public void mouseReleased()
{
stand[i] = 1 - stand[i];
}

}


and the Arduino Code:


Code:
#include <WProgram.h>
#include <stdio.h>

#define LatchPin 8
#define ClockPin 12
#define DataPin 13

byte chardata[] =
{
  B00111111, //0
  B00000110, //1
  B01011011, //2
  B01001111, //3
  B01100110, //4
  B01101101, //5
  B01111101, //6
  B00000111, //7
  B01111111, //8
  B01101111 //9
 };

extern "C" void __cxa_pure_virtual()
{
  cli();
  for (;;);
}

int i = 0;
int led;
int oldled;
char ascii[6];

void setup() {
Serial.begin(9600);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(LatchPin, OUTPUT);
pinMode(ClockPin, OUTPUT);
pinMode(DataPin, OUTPUT);
pinMode(A0, INPUT);
digitalWrite(LatchPin, LOW);
shiftOut(DataPin, ClockPin, MSBFIRST, 0);
digitalWrite(LatchPin,HIGH);
}

void loop()
{
int slider1 = analogRead(A0);
Serial.write(slider1);
if(Serial.available())
{
led = Serial.read();
if ( led == 'A')
digitalWrite(6, HIGH);
if (led == 'B')
digitalWrite(6, LOW);
if (led == 'C')
digitalWrite(5,HIGH);
if (led == 'D')
digitalWrite(5, LOW);
if(led!=oldled)
{
digitalWrite(LatchPin, LOW);
shiftOut(DataPin, ClockPin, MSBFIRST, chardata[led]);
digitalWrite(LatchPin,HIGH);
oldled = led;
}
}

}


int main (void)
{
init ();
setup();
for(;;)
loop();
}
12  Using Arduino / Interfacing w/ Software on the Computer / Processing Seriel communication Question on: March 27, 2011, 12:26:54 pm
Hi guys,

i have following question. Is there a way, that both Serial.write(port.write) and Serial.read(port.read) will work in one code?

Because until now, i can run either serial.write or serial.read but if i put them both in one code, just the first function is working....

I have to send from my Arduino Duemilanove some informations to Processing and on the other way some information from Processing to Arduino...

I hope somebody can help me. I'm pretty new in this.

Best Regards,

HammerH
13  International / Deutsch / Processing - Arduino- Serielles Problem bei minimieren. on: March 24, 2011, 09:43:03 am
Hi,

ich hab folgendes Problem:

Ich arbeite in Eclipse und programmiere dort sowohl Processing als auch Arduino. Der Arduino soll mit Processing seriell kommunizieren.

Es funktioniert soweit auch alles aber sobald ich das Processing Fenster minimiere und dann wieder öffne, stürzt sich Processing ab und es geht nicht weiter.

Ich erhalte folgende Fehlermeldung:

Quote
java.lang.NullPointerException
   at processing.serial.Serial.write(Unknown Source)
   at DangerShield.draw(DangerShield.java:57)
   at processing.core.PApplet.handleDraw(Unknown Source)
   at processing.core.PApplet.run(Unknown Source)
   at java.lang.Thread.run(Thread.java:662)
Exception in thread "Animation Thread" java.lang.RuntimeException: Error inside Serial.write()
   at processing.serial.Serial.errorMessage(Unknown Source)
   at processing.serial.Serial.write(Unknown Source)
   at DangerShield.draw(DangerShield.java:57)
   at processing.core.PApplet.handleDraw(Unknown Source)
   at processing.core.PApplet.run(Unknown Source)
   at java.lang.Thread.run(Thread.java:662)


Ist das normal, dass es sich aufhängt nachdem man das minimierte Fenster wieder öffnet?


Liebe Grüße,

HammerH
14  Using Arduino / Interfacing w/ Software on the Computer / Re: Newbie Question: Eclipse and Processing on: March 04, 2011, 08:55:48 am
Ok, after no one answers, let me put the question in another way.

Is it possible, that I can program with Eclipse and upload it to the Android by using the Processing Plug-In?
15  Using Arduino / Interfacing w/ Software on the Computer / Newbie Question: Eclipse and Processing on: March 03, 2011, 10:33:44 am
Hi,

I'm using Ubuntu and have following problem:

I want to use Processing in Eclipse while programing something on my Arduino Duemilanove.

I already configured Eclipse successfully to use my Arduino and the upload is working fine,too.

I also installed the Processing plug in and something simple like creating an ellipse is working fine.

But I don't know how to combine those two. I'd like to make a code in which I press a button which lights an LED and there shall be a window on my screen which shows me which LED is lighted. The Code for the Arduino is the following one:


Code:
#include <WProgram.h>

const int button1 = 2;
const int button2 = 7;
const int button3 = 4;
int state = LOW;
int press1 = 0;
int press2 = 0;
int press3 = 0;

void setup () {
pinMode(6, OUTPUT);
pinMode(5, OUTPUT);
}

void loop () {
press1 = digitalRead(button1);
press2 = digitalRead(button2);
press3 = digitalRead(button3);
if (press1 == 1)
{ state = !state;
digitalWrite(6, state);
}
if (press2 == 1)
{ state = !state;
digitalWrite(5, state);
}
if (press3 == 1)
{ digitalWrite(5, LOW);
digitalWrite(6, LOW);
}
delay (400);
}

int main(void)
{
init ();
setup();
for(;;)
loop() ;
}


How can I integrate Processing and Arduino in Eclipse? I've already googled but with no success.

Thanks for your answers.

Best Regards,

HammerH
Pages: [1] 2