Instead of a 50K pot can I use pwm signal to control it?
And in the loop write pwm*4 since pwm is 255 and analog is 1023?
Instead of a 50K pot can I use pwm signal to control it?
And in the loop write pwm*4 since pwm is 255 and analog is 1023?
Use
/* Map an analog value to 8 bits (0 to 255) */
void setup() {}
void loop()
{
int val = analogRead(0);
val = map(val, 0, 1023, 0, 255);
analogWrite(9, val);
}right from arduino library Arduino - Map
as far as replacing the POT control, it depends on wht it is connected to, you may need an RC filter to restore the PWM to an Analog Value
As mark asked, what is this connected to
AN audio amplifier 50k pot volume control
Are you asking how you might control the volume in an audio system by using the Arduino to operate the 50k pot ?
If so there are two obvious solutions:
use a motorised pot like this Buy Potentiometers Motorised carbon dual pot,50K log 27mm Alps RK27112MC01P online from RS for next day delivery. (there are other sources on the web - Google)
use a solid state pot like this AD5160BRJZ50-RL7 - ANALOG DEVICES - DIGITAL POT, 50KOHM, 256, SINGLE | Farnell UK
If you could explain in a lot more detail what you are trying to do it would be easier to help.
MK
Are you asking how you might control the volume in an audio system by using the Arduino to operate the 50k pot ?
If so there are two obvious solutions:
use a motorised pot like this Buy Potentiometers Motorised carbon dual pot,50K log 27mm Alps RK27112MC01P online from RS for next day delivery. (there are other sources on the web - Google)
use a solid state pot like this AD5160BRJZ50-RL7 - ANALOG DEVICES - DIGITAL POT, 50KOHM, 256, SINGLE | Farnell UK
If you could explain in a lot more detail what you are trying to do it would be easier to help.
MK
trying to use pwm instead of a analog pot. The arduino will be connected instead of the three wires(i'am using only 2 G and S) and I will have a infrared receiver and when I send an signal to the mcu,it will adjust the signal and since pwm is 255 and analog is 1023 if I type pwm*4
in the loop will it work(I don't want my computer crashing)?
I'm sorry but I don't understand - can you draw us a diagram ?
Where is the pot in the system - what does it control ?
MK