so far this program doesn't work, but I am going to comment it anyway so that I can try to fixit(i wrote it then remembered to comment.)so i wanted to make a rgb color lamp with user-selectable color, and I thought i should use potentiometers.so i connected 3 5k pots to analog pins 0, 1, and 2(with the other2 leads connected to 5v and gnd, so that couldn't be the problem).I connected a rgb led to digital pins 9, 10, adn 11(they are the ones with pwm on my arduino.)and i put the gnd pin to ground.by the way, I'm using a deumilanove. I have a tragic history of buying a gadget and then a few weeks later the company comes out with a newer, better one. so of course Arduino came out with the Arduino uno a few weeks after I bought my deumilanove. =(anyway, I'll stop rambling and comment the sketch.i was just commenting the serial connection and i realized i forgot to mention that I'm sending the data to the serial port toofor debugging.before this i sent to pot values to the serial port only, and thatworked, so it's probably the mapping and led pwming that's the problem.this is my first major attempt at programming anything more thana blink program and im only 12.*/int pot_red = 0; //variables for storing the pot data.int pot_green = 0; //red, green, and blue since it's a rgb lamp.int pot_blue = 0; //and set them at zero so the led doesn't //flicker at the beggining of the sketch.

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.Do not send technical questions via personal messaging - they will be ignored.I speak for myself, not Arduino.

Andrew_P.

@AWOL, sorry I didn't include what the debug input looks like, it looks like this:r = 564 g = 227 b = 218r = 564 g = 227 b = 215r = 564 g = 228 b = 217and goes on and on and on.(this is in the serial monitor window in the Arduino development environment)The part where the pot data gets sent through the serial connection seems to be working. The LED doesn't light up at all, even if I turn the knobs.

Good thing you provided the sketch. Also a description of how you connected the potentiometers (or pots). Which sounds right btw. But no description of what kind of LED(s) you have (as AWOL is suggesting, common cathode or perhaps common anode), or if you use any resistors connected to them. Which you really (really!) should, so you don't destroy your Arduino. One resistor pr. Arduino output, to the LEDs different color pins. Then the common LED pin to either GND or Vcc, depending on the type of led. (If common anode, to the Vcc, and then you should also invert the analogWrite values - which in that case would be to take 255 and subtract your remapped pot_color values)

This could be lucky if you didn't use any resistors, as the Arduino have an internal "pull-up" resistor at around 20 k ohm that is turned on if an INPUT pin (as an undefined pin would be) gets written a "1". But if this was the case, you should (maybe) notice a very dim LED.

Btw, don't feel bad for not having the newest one, the main difference as I understand it, is that the new Arduino Uno have a built-in USB connector (so no need for an external USB board with an FTD chip or similar).

@raron:pinMode isn't necessary; it is taken care of by calling analogWrite.

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.Do not send technical questions via personal messaging - they will be ignored.I speak for myself, not Arduino.

Andrew_P.

@raron, I did use 100 ohm resistors on each pin of the led except for the common cathode.@pauls, thank u for ur advice, but I don't have my arduino with me now. I will try it as soon as I can, and post whether it worked on this forum.