0

Run Adalight Script without pop up Window!?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Run Adalight Script without pop up Window!?

by jadonv on Mon Jun 25, 2012 7:35 pm

Hi i was wondering if there was anyway to change up the code to adalight.pde so that there is no window that ops up after running it. ? Thanks so much look forward to a reply.

jadonv
 
Posts: 23
Joined: Sat Jun 16, 2012 1:52 pm

Re: Run Adalight Script without pop up Window!?

by pburgess on Tue Jun 26, 2012 1:12 am

It's tricky, because Processing is sort of implicitly a visual tool. But here's a kludge that seems to work for Mac and probably Linux. I'm not sure about Windows, but changing "/dev/null" to "\Device\Null" might do the trick.

Make a copy of Adalight.pde, because this is a pretty drastic change.

Add this line to the top of the sketch:
Code: Select all | TOGGLE FULL SIZE
import processing.pdf.*;

Find this line (around line 232 or so):
Code: Select all | TOGGLE FULL SIZE
  size(totalWidth * pixelSize, maxHeight * pixelSize, JAVA2D);

and change it to:
Code: Select all | TOGGLE FULL SIZE
  size(totalWidth * pixelSize, maxHeight * pixelSize, PDF, "/dev/null");

Scroll up and find this line, around line 138-ish:
Code: Select all | TOGGLE FULL SIZE
  port = new Serial(this, Serial.list()[0], 115200);

MOVE this line (and the comments around it, if you like) DOWN so that it appears right AFTER the "size" line.

Give it a shot and see what you get.

pburgess
 
Posts: 3984
Joined: Sun Oct 26, 2008 2:29 am

Re: Run Adalight Script without pop up Window!?

by jadonv on Fri Jun 29, 2012 4:41 pm

this worked perfectly and is just perfect for advanced launcher in xbmc! thanks a bunch!

jadonv
 
Posts: 23
Joined: Sat Jun 16, 2012 1:52 pm

Re: Run Adalight Script without pop up Window!?

by jadonv on Sat Aug 11, 2012 1:52 pm

BTW this speeds the lights up times 100

jadonv
 
Posts: 23
Joined: Sat Jun 16, 2012 1:52 pm

Re: Run Adalight Script without pop up Window!?

by simglance on Thu Jan 09, 2014 8:19 pm

Has anyone figured this our for Windows 7? I tried changing changing "/dev/null" to "\Device\Null" with no luck.
simglance
 
Posts: 2
Joined: Sun Dec 15, 2013 4:42 pm

Re: Run Adalight Script without pop up Window!?

by jsimon836 on Mon Nov 10, 2014 9:08 pm

So this entire setup works perfect except my red and blue controls are switched. For example, If I put a blue object near the edge of the screen it shows up red on the LEDs. The processing preview shows the right color. The arduino sequence shows Blue green red not RGB. Please Help!

Thanks!

jsimon836
 
Posts: 2
Joined: Mon Nov 10, 2014 9:05 pm

Re: Run Adalight Script without pop up Window!?

by pburgess on Mon Nov 10, 2014 11:32 pm

Open the file Adalight.pde in Processing and look for this block of code (around line 386):
Code: Select all | TOGGLE FULL SIZE
    // Apply gamma curve and place in serial output buffer
    serialData[j++] = gamma[ledColor[i][0]][0];
    serialData[j++] = gamma[ledColor[i][1]][1];
    serialData[j++] = gamma[ledColor[i][2]][2];

Reverse the order of 0 & 2 and everything should be good:
Code: Select all | TOGGLE FULL SIZE
    // Apply gamma curve and place in serial output buffer
    serialData[j++] = gamma[ledColor[i][2]][2];
    serialData[j++] = gamma[ledColor[i][1]][1];
    serialData[j++] = gamma[ledColor[i][0]][0];

pburgess
 
Posts: 3984
Joined: Sun Oct 26, 2008 2:29 am

Re: Run Adalight Script without pop up Window!?

by jsimon836 on Tue Nov 11, 2014 8:49 pm

Thank you so much for the quick and helpful response the color shift worked!

I have two more quick questions, was there ever a solution to the preview window being hidden on Windows? And when I try to export the application in Processing neither of the created applications for 32 bit or 64 bit work for my system. I am running 64 bit. any advice with making the standalone export version work with Windows?

Thanks so much in advance for your help. This project looks great and I appreciate all your hard work.

jsimon836
 
Posts: 2
Joined: Mon Nov 10, 2014 9:05 pm

Re: Run Adalight Script without pop up Window!?

by Tim92 on Wed Apr 01, 2015 1:07 pm

For any Windows Users searching this topic: you have to use "NUL" instead of "dev/null/".

see here: http://stackoverflow.com/questions/3131 ... in-windows

Tim92
 
Posts: 2
Joined: Wed Apr 01, 2015 1:05 pm

Re: Run Adalight Script without pop up Window!?

by muedelaisla on Mon Dec 25, 2017 5:27 am

is possible an android smart box?? by otg port and processing apk??

muedelaisla
 
Posts: 1
Joined: Mon Dec 25, 2017 5:22 am

Please be positive and constructive with your questions and comments.