i have an idea, and it'll be awsome!! heres what the situation is: we have 2 potentiometers, and 3 leds (RGB) and a 7 segment display. so we could do this: we can use one potentiometer to control the mode ( either mode 1:led 1, mode 2:led 2, or mode 3:led3 ) and use the second potentiometer to controll the brightness of each led, and put em all in pwm obviously. And use the 7 segment display to tell us what mode were in.
so we turn one potentiometer, and itll tell us which led were controling, and then we use the second potentiometer to tell us the birghtness of the led's, and the mode is displayed on the 7 segment display.
but i need somebody who can code this up for me, cuz i think i can only code the 7 seg display, so any one up for the challenge??
thanks in advance!
-big93
Here is fragment to select the led that can get you started:
#define POT_PIN 1 // the analog pin that the post is connected to #define NBR_OF_MODES 3 // the number of leds
int potvalue = analogRead(POT_PIN); // read the pot position
int mode = potvalue /(1024 / NBR_OF_MODES); // divide 1024 max pot value by number of modes
in this example, mode will range between 0 to 2 as the pot is rotated:
cuz if thats the code for mode changing, i think i might be able to code the rest myself, wait except brightness, and controlling it with the potentiometer... can u code that also please?
thanks mem!
big93
IDE: Integrated Development Environment. It is the program called arduino.exe that you run to create and compile sketches. In the main menu, see File ->Sketchbook->Examples->Analog->Fading