Show Posts
Pages: [1]
1  Using Arduino / Sensors / Re: Analogin Pot value inaccuracy on: November 20, 2012, 05:20:41 pm

why
currentColorValueRed = (255 - map(analogRead(redPotPin), 0, 1023, 0, 255 ));

and not

currentColorValueRed = analogRead(redPotPin) /4;  // works almost the same (only inverted)

I figured that was the way to reverse the value...I'll try your way to test...
2  Using Arduino / Sensors / Re: Analogin Pot value inaccuracy on: November 20, 2012, 02:01:07 pm
Solved!

Thank's all for the help...

I changed the 3 pot to 10k and rewrite my code...

Code:
char buffer[16]="";

void setup ( )
{
  iLCD.begin ( 16, 2 );

}

void loop ()
{
  
 iLCD.home ();
  
  currentColorValueRed = (255 - map(analogRead(redPotPin), 0, 1023, 0, 255 ));
  delay(1);
  currentColorValueGreen = (255 - map(analogRead(greenPotPin), 0, 1023, 0, 255 ));
  delay(1);
  currentColorValueBlue = (255 - map(analogRead(bluePotPin), 0, 1023, 0, 255 ));
  delay(1);
  
  sprintf(buffer, "R:%3dG:%3dB:%3d", currentColorValueRed, currentColorValueGreen, currentColorValueBlue);
  iLCD.print(buffer);
  
}
3  Using Arduino / Sensors / Re: Analogin Pot value inaccuracy on: November 20, 2012, 08:58:46 am
You need to look at smoothing the value. Check the Arduino web site for examples. Basically to take a certain number of samples and then average them. Not sure how many you need. Fewer will be quicker but less actuate and more will be slower and more accurate. It doesn't matter to much about that for most applications i've had 8/10.. more pots connected to an Uno using multiplexing and smoothing with no real noticeable delay.

I'd like to use 0-255 range since my goal is to control a RGB LED. (each pot corresponds to a color value R, G, B). The strange behavior is getting 001 or 0041 instead of 0 or random numbers wher it shoulbe be 255... Maybe it's a LCD problem since it print 789 or 999 that's a value out of the map() range??
4  Using Arduino / Sensors / Analogin Pot value inaccuracy on: November 20, 2012, 08:30:22 am
Hi,

I hooked 3 pots(100k each) to pins (A0, A1, A2) in my Arduino UNO (Rev 3).
I want to map() each pot value to a LCD. I'm using the 3-wire (595 shift register) with the lcd.
The problem is I got very messy readings from the pots. Sometimes in the middle position of pot A1 the LCD is showing 987...I never get 0 - 255 exactly.
Here part of my code

Code:
void loop ()
{
  
   iLCD.home ();
 currentColorValueRed =  analogRead(redPotPin);
  delay(2);
  currentColorValueBlue = analogRead(bluePotPin);
  delay(2);
  currentColorValueGreen = analogRead(greenPotPin);
  delay(2);
  
 
 
  iLCD.print("R:");
  iLCD.print(map(currentColorValueRed, 0, 1023, 0, 255 ));
  iLCD.setCursor(5, 0);
  iLCD.print("G:");
  iLCD.print(map(currentColorValueGreen, 0, 1023, 0, 255 ));
  iLCD.setCursor(10, 0);
  iLCD.print("B:");
  iLCD.print(map(currentColorValueBlue, 0, 1023, 0, 255 ));
}
5  Using Arduino / Project Guidance / 7-segment display and 4067BP on: June 13, 2012, 06:40:34 pm
Hi all,

Is it possible to use mux 4067BP to control 2 digit 7-segment display? I'd like to build a countdown timer. If so, can anyone point me in some direction?

thank's in advance.

best,
6  Using Arduino / LEDs and Multiplexing / Re: HEF4067BP and multiple analog output on: May 06, 2012, 04:27:10 pm
Grumpy_Mike, thank's for the response.
What kind of chip I will need in this case?
7  Using Arduino / LEDs and Multiplexing / Re: HEF4067BP and multiple analog output on: May 06, 2012, 03:54:10 pm
Maybe I'm not expressed myself well. I'm new to Arduino.
I'm using a Arduino UNO R3 and a HEF4067BP in order to control 5 RGB Led's. The HEF4067 is connected to ports 3,5,6,9 and 8 of Arduino's board.
What I'm trying to do is to output a different RGB value to each one of the 5 led connected to 4067. In my sketch I got 5 different hexa values. I converted this values to 5 different RGB values and I want to light up each led with this values.
8  Using Arduino / LEDs and Multiplexing / HEF4067BP and multiple analog output on: May 06, 2012, 02:03:03 pm
Is it possible to have multiple analog outputs? I have 5 RGB led's. How can I control all of it? I'm trying to use the HEF4067BP but it seems it cannot send analog values or maybe I couldn't discover how.
Does anyone can give me a direction?

Thank's in advance
Pages: [1]