Hello! I would like to control/regulate the luminous power with the TX potentiometer. (VrA or VrB) Can you write me a code for that? Thanks!
int led = 9; int chan = 5; int Channel; void setup() { pinMode(chan, INPUT); pinMode(led, OUTPUT); Serial.begin(9600); } void loop() { Channel = (pulseIn(chan,HIGH)); Serial.println(Channel); if (Channel > 1900 ) { digitalWrite(led,HIGH); } if (Channel < 1000) { digitalWrite(led,LOW); } }
Hello! I would like to control/regulate the luminous power with the TX potentiometer. (VrA or VrB) Can you write me a code for that? Thanks!
int led = 9;
int chan = 5;
int Channel;
void setup()
{
pinMode(chan, INPUT);
pinMode(led, OUTPUT);
Serial.begin(9600);
}
void loop()
{
Channel = (pulseIn(chan,HIGH));
Serial.println(Channel);
if (Channel > 1900 )
{
digitalWrite(led,HIGH);
}
if (Channel < 1000)
{
digitalWrite(led,LOW);
}
}