Show Posts
Pages: [1] 2 3 ... 5
1  Using Arduino / Project Guidance / Re: RFID Video Daemon on: April 13, 2011, 05:46:56 pm
i dont even know what foofoo is  smiley-confuse
2  Using Arduino / Project Guidance / Re: RFID Video Daemon on: April 13, 2011, 04:37:11 pm
The video's are playing and the sound is playing but every so often the file will crash and deliver this report:

Quote
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
3600A9C9F8
360073D274
3600A9C9F8
F0000000F0
The file "F0000000F0.mov" is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable.
error, disabling serialEvent() for //./COM4
java.lang.reflect.InvocationTargetException
   at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
   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.NullPointerException
   at quicktime.util.QTHandle.<init>(QTHandle.java:287)
   at processing.video.Movie.init(Unknown Source)
   at processing.video.Movie.<init>(Unknown Source)
   at processing.video.Movie.<init>(Unknown Source)
   at dumdum.serialEvent(dumdum.java:80)
   ... 7 more
3  Using Arduino / Project Guidance / Re: RFID Video Daemon on: April 13, 2011, 02:20:30 pm
Working great now.

I had to put them after the code mentioned.

Sometimes i get a null pointer reference but the program still works.

Thank you this is great.

You've been a great help.

Thank you
4  Using Arduino / Project Guidance / Re: RFID Video Daemon on: April 12, 2011, 08:06:41 pm
Perfect smiley-mr-green

Now I need to work out how to stop the audio files from overlapping.

I was thinking of using: myMovie.dispose();  player.close(); and minim.stop(); but i'm not sure where to put it.

Updated Code:
Code:
import processing.serial.*;
import processing.video.*;
import jmcvideo.*;
import ddf.minim.*;

AudioPlayer player;
Minim minim;

Serial myPort;  // The serial port
Movie myMovie;

void movieEvent(Movie m) {
  m.read();
}

void setup() {
    size(320,240,P3D);
     minim = new Minim(this);
  // Open whatever port is the one you're using.
  myPort = new Serial(this, Serial.list()[1], 2400);

  background(0);
 
}

void draw() {

 
  if (myMovie != null){
      image(myMovie, 0, 0);
      smooth();
      ///image(myMovie, 0, 0, 320, 240);
  }
 
}

void serialEvent(Serial p){
  while (myPort.available() >= 10) {
   //Video Code:
  String command = "";
  for (int i=0;i<10;i++){
     command += myPort.readChar();
  }
  println(command);
  myMovie = new Movie(this, command+".mov");
  player = minim.loadFile(command+".wav", 2048);
  //myMovie.setSize();
  myMovie.play();
  player.play();
  }
}

Many Thanks
5  Using Arduino / Project Guidance / Re: RFID Video Daemon on: April 12, 2011, 05:48:33 pm
I have got audio to work now.

The only problem is the video plays as if it has lag.

I've asked for help on the processing forum.

Thought I would mention is here as well.

Thanks again.
6  Using Arduino / Project Guidance / Re: RFID Video Daemon on: April 12, 2011, 03:15:13 pm
Should I mark this as solved and create a new forum post asking about the audio?

I can't thank you enough lesto.
7  Using Arduino / Project Guidance / Re: RFID Video Daemon on: April 12, 2011, 02:59:31 pm
oh my, the previous code that I was working with actually works now.

The error was in the arduino board, I would never of thought of that.

That was perfect what you said and println was the problem too.

Now its just a matter of the sound playing all the way through.

I can extract the audio no problem if needed.

I will put the code I was originally using:

Quote
import processing.serial.*;
import processing.video.*;
import jmcvideo.*;

Serial myPort;  // The serial port
Movie myMovie;

void movieEvent(Movie m) {
  m.read();
}

void setup() {
    size(400,400,P3D);
  // Open whatever port is the one you're using.
  myPort = new Serial(this, Serial.list()[1], 2400);

  background(0);
 
}

void draw() {
while (myPort.available() >= 10) {
  //Video Code:
  String command = "";
  for (int i=0;i<10;i++){
     command += myPort.readChar();
  }
  println(command);
  myMovie = new Movie(this, command+".mov");
  //myMovie.setSize();
  myMovie.play();
}
 
  if (myMovie != null){
      image(myMovie, 0, 0);
       //image(myMovie, 0, 0, width, height);
  }
 
}

Thank you sooooo much, your obviously very knowledgable with arduino!!!!!  smiley-mr-green
8  Using Arduino / Project Guidance / Re: RFID Video Daemon on: April 12, 2011, 02:51:09 pm
It is so annoying if the error was at the start, but that would make sense.

Somehow I have updated the arduino with the code and tested the arduino and it works, why i left println instead of print i have no idea.

Your right, 10 variable is 0 inclusive, that would make sense.

I'm still getting a error on the processing side, a null pointer exception in the draw method at this line:

synchronized(playingMovie) {//to be sure we don't change video while it is changed by Serial command

I thought it was because it didn't have a video to play but there is sound coming from the program, it is loading file1 straight away.

Also, the sound turns off after 3 seconds.

I used your code previously submitted.

Should the if (playingMovie != null) code be above the synchronize?

Thanks so much for your help again.

Maybe it is feasible.
9  Using Arduino / Project Guidance / Re: RFID Video Daemon on: April 12, 2011, 02:25:39 pm
Thanks for your post.

I don't understand what the val is in relation to? The command variable?

Quote
if (length(command)!=10){ break; }

So there is not a possibility of using another file or program to close and open the daemon file that plays the video?

Thank you for replying, no other idea's out there any where?

Hope to hear something back
10  Using Arduino / Project Guidance / Re: RFID Video Daemon on: April 12, 2011, 01:17:18 pm
Does anybody have any possibilities for me please.

I have worked hard on this and got too far to turn back.

There is a solution somewhere, I'm sure of it.

Could someone please look at my code and help me.

Thank you very much.
11  Using Arduino / Project Guidance / Re: RFID Video Daemon on: April 12, 2011, 12:24:05 pm
I am guessing there are no solutions to this problem.

It isn't feasible after all.
12  Using Arduino / Project Guidance / Re: RFID Video Daemon on: April 11, 2011, 09:01:55 am
Just an idea,

Daemon files run in the background, does this mean I could have a program in the foreground????

.pde files are relatively new to me but i know .exe files can execute other .exe files on demand.

By this i mean could I have a program that reads the code once, executes a video on a different sketch, closes the sketch and waits for another.

Setup(){
//run intro video
//wait for rfid code
}

draw(){
//send code to daemon
//run daemon with video
//close daemon
}

Thank you, just an idea.
13  Using Arduino / Project Guidance / Re: RFID Video Daemon on: April 11, 2011, 08:43:37 am
Quote
360073D274

360073D
274

3600
73D274

3
60073D274


360073D2


Quote
3600A9C9F8


3600A9C
9F8

3600
A9C9F8

3
600A9C9F8


3600A9C9


It looks as though it is reading:

10 char's
7 char's + 3 char's
4 char's + 6 char's
1 char + 9 char's
8 char's

This is the same each time for seperate tags.

I can't determine why. First time is fine.
14  Using Arduino / Project Guidance / Re: RFID Video Daemon on: April 11, 2011, 08:39:09 am
Okay i'm sorry, i forgot to update the ID of the second tag!!!

The progblem is still the same. it will only read part of the serial after the first execution.

3600A9C9F8 First


3600A9C
9F8

3600     Second
A9C9F8

3
600A9C9F8  Third


3600A9C9



Sometimes it will run the code twice although the card is only supposed to be read once. In the above example I tried to use it three tiems but the code was produced almost 5.

I am beginning to believe this is a processing/arduino communication error and not a programming error.

Sorry again, and thank you so so much.

15  Using Arduino / Project Guidance / Re: RFID Video Daemon on: April 11, 2011, 08:25:46 am
Wow.

I have renamed my files to file1 and file2 which is a lot more practical than the original way.

An error is produced when it is run, not when the tag is used.

I am recieving a NullPointerException at   synchronized(playingMovie)

Apparently it is a runner exception.

Movie playingMovie; //the pointer to the actual playing movie, no movie = null

i make an introduction movie to run on startup if the problem is there is no movie, this will graphically look better.

This is brilliant, the buffer functions is really good idea, the Serial Event is also amazing.

Here is what I have tried:

Quote
void setup() {
  size(400,400,P3D);
  // Open whatever port is the one you're using.

  myPort = new Serial(this, Serial.list()[1], 2400);
  myPort.buffer(10);//that means don't call serialEvent until 10 carater are recived
  background(0);

  //here load and put all movie in the map.
  listOfMovie.put("3600A9C9F8", new Movie(this, "file1.mov") );
  listOfMovie.put("0000000000", new Movie(this, "file2.mov") );
  ///etc etc
  playingMovie = new Movie(this, "intro.mov");
}


When the  playingMovie = new Movie(this, "intro.mov"); line is added there is not a null pointer in playingMovie variable, even though it doesnt play the video.

Your code is amazing and i appreciate it greatly.

Is arduino more for robotics rather than software applications?

It just won't read the output correctly.

Thank you.
Pages: [1] 2 3 ... 5