We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpElectronics,  Serial Library › Carnivore affecting LED brightness
Page Index Toggle Pages: 1
Carnivore affecting LED brightness (Read 758 times)
Carnivore affecting LED brightness
Jun 4th, 2008, 1:21pm
 
Hi I am at a very amateur level.
But I really want to get carnivore client in processing to affect the brightness of LED's.

In an exact way to that of the 'dimmer' example that comes with the Arduino board.

This example is affected by mouse x which delivers a number between 0 and 255 to the arduino
to affect the brightness of the LED.

An example that I have found on the processing side that will scale the parts of an IP address to a number between
0 and 255 is this:

  // Use last two IP address bytes for x/y coords
   splitter = ip.lastIndexOf(".");
   y = int(ip.substring(splitter + 1)) * height / 255; // Scale to applet size
   String tmp = ip.substring(0, splitter);
   splitter = tmp.lastIndexOf(".");
   x = int(tmp.substring(splitter + 1)) * width / 255; // Scale to applet size

However, I would ideally like to affect multiple LED's.

However, I think for this post it's porbably best to just get the carnivore packet input
affecting an LED.

Thankyou and sorry for the basic level post.
Cheers.
JHT
Page Index Toggle Pages: 1