Show Posts
Pages: [1]
1  Using Arduino / LEDs and Multiplexing / Re: RGB Lamp based on Monitor dominant color on: April 08, 2013, 10:00:38 am
I think I'm going to try the "screenshots" way... Arduino + Processing, it seems to be working quite well at 10-15 fps.
If anyone else is interested, I recommend this post
http://siliconrepublic.blogspot.it/2011/02/arduino-based-pc-ambient-lighting.html
2  Using Arduino / LEDs and Multiplexing / RGB Lamp based on Monitor dominant color on: April 08, 2013, 08:18:09 am
Hi everybody,
In your opinion, would it be possible to connect an Arduino-controlled RGB lamp to a PC so that it would change its color basing on the dominant color displayed on the monitor?
I'm quite sure that connecting the Arduino to the PC with a USB port and make them communicate via RX-TX (maybe I'll write a Java app) is the easiest way to do this.
Do you know any way to get the dominant color on the screen (the hex value) in order to send it to the Arduino?
I looked for something like this on the internet but I didn't find anything like this... Maybe some of you know if something like this has already been developed?

Thank you very much for your help!

scarface78987

edit: I wanted to do something like this youtube.com/watch?v=jH4MgfICBWg but I was wondering if there is a way to get the values without having the program to make a screenshot every time...
3  Using Arduino / Interfacing w/ Software on the Computer / Re: Java interfacing with Arduino - Variable type problem on: December 09, 2012, 08:50:30 am
Thank you, it works!
I owe you a beer smiley
4  Using Arduino / Interfacing w/ Software on the Computer / Re: Help with processing GUI on: December 08, 2012, 11:31:53 am
I'd like to know this too!
5  Using Arduino / Interfacing w/ Software on the Computer / Re: Java interfacing with Arduino - Variable type problem on: December 08, 2012, 11:30:33 am
Thank you very much, I'm going to try this later.
I'll let you know if it works!
6  Using Arduino / Interfacing w/ Software on the Computer / Re: Java interfacing with Arduino - Variable type problem on: December 08, 2012, 10:29:27 am
Thanks, I'm new to programming so I don't know these things.
What should I write in the arduino sketch to make him convert the string into int to get a number from 0 to 255?
Thanks again for your reply
7  Using Arduino / Interfacing w/ Software on the Computer / Java interfacing with Arduino - Variable type problem on: December 08, 2012, 09:44:48 am
Hi everybody,
I'm working on a project in which a Java Servlet sends data to an Arduino (basing on a 0-255 input slider) and the Arduino microcontroller does an analogWrite to a LED connected to pin 10 to determine its brightness.
If I send a value like 'H' or 'L' to switch the LED on and off it works with a simple
case 'H':
          digitalWrite(led, HIGH);
          break;
case 'L':
          digitalWrite(led, LOW);
          break;
on the Arduino.
If the arduino reads another value I want it to do this:
analogWrite(led,i);
Arduino writes a constant number (83) to pin 10 but I can't figure out what's wrong. I just wanted to make him read a serial input and then write that number to the LED.
I think there's a problem in the data type, here are the two codes.

Arduino:
Code:
int led = 10;
int i;

void setup() {
        pinMode(led,OUTPUT);
        Serial.begin(9600);
}

void loop() {
        if (Serial.available() > 0) {
          i = Serial.read();
        switch (i) {
          case 'H':
          digitalWrite(led, HIGH);
      break;
          case 'L':
          digitalWrite(led, LOW);
      break;
          default:
          analogWrite(led,i);
        }
  }

An js in an html file invokes the Java Servlet and sends pos2 that is the position of the slider
Code:
$.ajax ({
url: 'http://localhost:8080/dip_ROV/LedRegolabiliServlet?valore='+pos2,
dataType: 'text',
success: function(data) {
alert(data);
}
And then the Servlet writes the value to the Arduino (rov)
Code:
String valore = req.getParameter("valore");
rov.write(valore);

Thanks for the help!
scarface78987
Pages: [1]